faqts : Computers : Programming : Languages : PHP : Function Libraries : System

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

20 of 31 people (65%) answered Yes
Recently 4 of 10 people (40%) answered Yes

Entry

Why can I run a script on the command line but not from PHP?
Why can I use C to system call PHP and httpd fork PHP, but can't use httpd fork C to call PHP ?

Jan 22nd, 2000 17:36
Nathan Wallace, Gary Chen, Richard Lynch


First, check that you can run the script on the command line when logged
in as the user which PHP is running as.  If you have PHP running as an
Apache module this will most likely be the user nobody.  You can do this
by logging in as root and then doing:
    su nobody
If the scripts works when acting as the PHP user it should work from
PHP.
Another good thing to check is if there any files/resources that your
script needs to read/write/execute that the PHP user can't do.