system commands

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-12-2003
yawnmoth
 
Posts: n/a
Default system commands

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");

?>
Reply With Quote
  #2 (permalink)  
Old 08-13-2003
Chris Morris
 
Posts: n/a
Default Re: system commands

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
Reply With Quote
  #3 (permalink)  
Old 08-14-2003
yawnmoth
 
Posts: n/a
Default Re: system commands

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...
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0