Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: Kees Vonk on June 02, 2003, 02:09:05 PM
-
I have installed a SME 5.6 server for someone, which generally works great. However we cannot get PHP scripts to execute, every time we access a page which contains PHP (and has a .php extension) in the html directory we get a blank page. If we move the php page to cgi-bin we get a '500 Internal Server Error' and the httpd error_log says:
[Fri May 30 09:54:03 2003] [error] (13)Permission denied: exec of /home/e-smith/files/ibays/website/cgi-bin/phpindex.php failed
[Fri May 30 09:54:03 2003] [error] [client 10.1.2.67] Premature end of script headers: /home/e-smith/files/ibays/website/cgi-bin/phpindex.php
PHP is enabled in the ibays setup, we have PHPMyAdmin running without any problems and yet I cannot get php to execute in a normal ibay.
I have never done this before and do not know a lot about php so this is probably just something silly, but any help would be greatly appreciated.
Kees
-
Paste me your PHP code if you would, you have to be sure to include the PHP delimeters ?>;
Also, try a simple script like:
[Contents of test.php]
phpinfo(); ?>
[EOF]
Additionally, PHP may be working but you may have an error and may have display_errors turned off in /etc/php.ini, hence the blank page with nothing but header information.
Try turning error debugging on in /etc/php.ini (display_errors on), restarting httpd (/etc/rc.d/init.d/httpd restart), and accessing the page again. You won't be able to execute php scripts in cgi-bin, so don't bother trying there.
Hope this helped,
Nathan
-
Thank you,
the test.php worked straight away, so I then set display_errors to 'on' and up popped the error I was looking for (it now also appears in the syslog which it didn't do before).
One more question though, is it possible to set display_errors for an individual website (ie. set the global default to 'off' and then change it for the one ibay)?
Thank you very much,
Kees
-
I'm very happy I was able to help you, I know how frustrating that stuff can be. ;)
I think you can use ini_set to set this value for a particular site upon execution of the PHP code.
http://us2.php.net/manual/en/function.ini-set.php
IE:
//Get previous value.
$prev_value = ini_get("display_errors");
//Set the value
ini_set("display_errors","1");
//Do some of your code here
//Blah blah, code code
//Set the value back to it's original
ini_set("display_errors",$prev_value);
?>
-
Note, on the bottom of the page under user comments this user says (but I've not yet validated it):
JeDi at Zwelche dot de
24-Apr-2003 06:30
There is another possibility by changing PHP Settings!
If your Webspace is able to handle ".htaccess" files, you're able to change PHP_INI Settings through this file!
To disable register_globals you have to set:
php_value register_globals 0
If you wanna set other settings, feel free, because there is no problem!
These Settings are set before running the script, e.g. the results of register_globals, when setting a parameter in the URL like 'foo.php?foo=stuff', is not present, $foo is unset.
-
Thank you Nathan,
the .htaccess thingy works, thank you very much for all your help. I wish I got this level of support everywhere.
Kees
-
Behold the power of an open source community willing to help ;)
I'm glad everything is working great, now you can pass your expertise along to someone else with the same problem.
Thanks,
Nathan