PHP Fcgi Woes!
Just uploaded a new PHP script to our web server and got this:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /usr/local/psa/home/vhosts/xxx/httpdocs/xxx on line 37
The new file is PHP5, the web server is running PHP4.xx.
After the installation of PHP5, I tried the page again:
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ‘}’ in /usr/local/psa/home/vhosts/xxx/httpdocs/xxx on line 37
Same thing, it’s a shared host with both PHP4 and PHP5 so a .htaccess file containing the following is required, put it in the root of the site or the application application directory with your PHP files if you only need it for part of the site:
RemoveHandler .php
AddType application/php5-fcgi php
Action application/php5-fcgi /cgi-bin/php5fcgi.fcgi
(this assumes that you have the appropriate fcgi file in your cgi-bin )
This solved the problem and the script now works as expected.
Tags: htaccess, programming
