On Fri, March 30, 2007 11:20 am, Nathan Ziarek wrote: > I'm capturing the output of exec in an array -- exec("command", > $array); > > Shouldn't $array have the error from bash? Nope. Errors go to stderr, and output goes to stdout, and never the 'twain shall meet. Unless you re-direct in your command with 2>&1 and the shell PHP is using supports that, which I suspect not. So then you can write your own shell script that has #!/bin/bash at the top, which then calls gnomefvs_info (or whatever) but also has the re-direct of stdout to stderr so you can capture "everything" that way. > > Researching this more, I found this command that returns the error: > > exec(gnomevfs-info file.doc 2>&1) --- gives me this: > > (gnomevfs-info:27496): libgnomevfs-WARNING **: Unable to create > ~/.gnome2 directory: Permission denied > Cannot initialize gnome-vfs. > > So Gnome is trying to make a folder in a user directory (www-data, the > apache2 user?) that either doesn't exist or can't be created. Yes, the Apache user. Can you su to that Apache user, and create that directory? Actually, I wonder if ~ is even set as you'd expect... > Any ideas on a work around for this? I don't see any way to specify > where Gnome makes this directory. Write the mini-shell-script suggested above, with that extra bit set to make it suid or whatever it's called, so it can make the directory it needs to make. You could also try to SetEnv('~=/whatever/you/want'); before you do the exec(). -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php