Page 1 of 1

Executing Shell Scripts

Posted: Wed Dec 08, 2004 7:10 am
by flanakin
I'm new to PHP and have just setup a server for the first time. Because of issues with how the server was setup before adding PHP, it had to be setup using IIS. Now, there's an open source tool that I'm using and it needs to run a command. I'm not sure why, but it's not working. I've done some searching and have found that safe_mode must be turned off. I checked this 3 ways: php.ini, [php_man]php_info[/php_man](), and [php_man]var_dump[/php_man]([php_man]ini_get[/php_man]('safe_mode')). The results I get are Off, Off, and string(0) "". I changed the php.ini file to 0 and received string(1) "0" for the [php_man]var_dump[/php_man](), but I'm not sure if any of that matters. Either way, my [php_man]popen[/php_man]() call is not working.

If anyone could help me figure out what's going on here, I'd appreciate it. Thanks.

Posted: Thu Dec 09, 2004 1:23 am
by rehfeld
whats the error message?

post your code too

Posted: Thu Dec 09, 2004 10:40 am
by flanakin
Actually, there is no error message, which is driving me crazy. When something doesn't work, it just stops. Nothing else gets processed and nothing gets displayed to the screen. I wish I knew why this was.

Posted: Mon Dec 13, 2004 2:52 pm
by rehfeld
in php.ini make sure

display_errors = On



also put this at the top of the script

error_reporting(E_ALL);


popen() could be disabled, but i think php would give you an error.

and of course make sure the popen() call is actually valid