This is a discussion on system commands within the PHP Language forums, part of the PHP Programming Forums category; i'm running the following php script, and where i would expect it to create a file, test.txt, it ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
i'm running the following php script, and where i would expect it to
create a file, test.txt, it doesn't. it isn't in the directory i am exectuting the script in, nor can i do cat on it (not that i would expect to, since it doesn't exist, heh): <?php print system("ls > test.txt"); print system("cat ls.txt"); ?> |
|
|||
|
yawnmoth <terra1024@yahoo.com> writes:
> i'm running the following php script, and where i would expect it to > create a file, test.txt, it doesn't. it isn't in the directory i am > exectuting the script in, nor can i do cat on it (not that i would > expect to, since it doesn't exist, heh): > > <?php > > print system("ls > test.txt"); > > print system("cat ls.txt"); cat test.txt, surely? > ?> Is safe mode enabled? If so, is there an ls and a cat program in the safe_mode_exec_dir? -- Chris |
|
|||
|
On 13 Aug 2003 10:16:56 +0100, Chris Morris <c.i.morris@durham.ac.uk>
wrote: >yawnmoth <terra1024@yahoo.com> writes: >> i'm running the following php script, and where i would expect it to >> create a file, test.txt, it doesn't. it isn't in the directory i am >> exectuting the script in, nor can i do cat on it (not that i would >> expect to, since it doesn't exist, heh): >> >> <?php >> >> print system("ls > test.txt"); >> >> print system("cat ls.txt"); > >cat test.txt, surely? hehe - that was the problem :) however, that doesn't help me solve the problem i was hoping it would solve :( if that works, then why doesn't this work?: <?php system("mysqldump --opt -u $dbuser --password=$dbpasswd $dbname | gzip > $dbname" . ".gz"); print "<a href=\"$dbname" . ".gz\">Download backup</a>"; ?> ls > test.txt outputted to the directory the php script was in (as i would expect it to), so why doesn't that? i can't find that file anywhere, and when i run the mysqldump command through the command line, it works just fine... |