Re: system command?
| From: | Jas | Date: | Mon, 10 May 2004 15:00:42 +0000 |
| Subject: | Re: system command? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185806@lists.php.net to get a copy of this message | ||
I didn't sent off list, always to php.general in reply to whatever message thread I am in. In any event, I have tried safe mode = On and safe mode = Off with the 4 commands I listed in my last thread and my actual code is using an echo = "<textarea>$tailed</textarea>";
I even tried to remove the -f and replaced it with a -n 600 (for six hundred lines to be output) and it still wont place the $tailed var into the textarea. It will output to the screen but not to the textarea, I am just going to scrap it and try it a different way.
Cheers,
Jas
Jay Blanchard wrote:
[snip] It is now... but it still doesn't work. I have tried passthru(), exec(), shell_exec() & system() trying to tail -f a log file into a textarea box and I get nothing or the output is put in the headers and stops the rest of the page from loading. I am at a loss. Jay Blanchard wrote:[snip] Anyone know what this wouldn't work? I have tried using a couple of functions defined at http://us2.php.net/manual/en/ref.exec.php andnoneseem to have the desired effect. <?php $tailed = shell_exec('tail -f /path/to/log'); //$tailed = exec('tail -f /path/to/log'); //$tailed = system('tail -f /path/to/log'); print = "<textarea>$tailed</textarea>"; ?> [/snip] Is PHP running in safe mode?[/snip] a. safe mode must be OFF b. you must remove the "=" from the print statement, should be thrwoing a syntax erro c. get rid of the -f as it will not continue to update the text area d. do not reply off-list unless requested