NYCPHP Meetup

NYPHP.org

[nycphp-talk] using exec or backticks

Seth seth at ghiek.com
Fri Jun 28 20:38:25 EDT 2002


Ian --

fwiw, I have a .php script that will dump an entire database out as an
ascii, comma-delimited file to the directory of your choice. It runs from
the web, generally from within my Admin section.

spirits,

seth
----- Original Message -----
From: "Chauncey Thorn" <cthorn at wt.net>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Friday, June 28, 2002 8:32 PM
Subject: Re: [nycphp-talk] using exec or backticks


> 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