NYCPHP Meetup

NYPHP.org

[nycphp-talk] using exec or backticks

Chauncey Thorn cthorn at wt.net
Fri Jun 28 15:04:19 EDT 2002


How are you doing?

Permissions needed for web server "user" to dump a file.

somewhere under web root
chown -R root.nobody dirname/
chmod -R g+w dirname/



Ian Forsyth wrote:

> I am trying to do a mysqldump using php..
>
> $command = "mysqldump -h localhost -u ian --password=something --opt
> adatabase > db.sql";
> $result = `$command`;
>
> or exec("mysqldump -h localhost -u ian --password=something --opt adatabase
> > db.sql");
>
> but on red-hat or mac os X (aka freebsd) i get nothing.. not even an empty
> file named db.sql..
>
> On my windows machine even is my login was incorrect, a file was still
> generated..
>
> which leads me to believe, for linux, is it an issue of permissions?
>
> $a = array();
> $int = 1;
> $c = "ls";
> exec($c,$a,$int);
> print_r($a);
>
> on both linux and windows. I get the same results from the above.. so it
> must be permissions.. should i try running it as a cgi?
>
> Ian..

--
Chauncey Thorn                  Internet: cthorn at wt.net
Linux Administrator - MCP       http://PCCS-Linux.COM
--------------------------------------------------------------
"Views expressed by this individual may differ from your own..."






More information about the talk mailing list