Hello:
I have a redhat 9 apache 1.3 server running on my machine. I wanted to install PHP5 on it but the problem is that I am already running PHP4 on the machine and have a website that uses PHP4 (running as an apche module) so I didnt just want to make the PHP4 to PHP5 change cold turkey. My goals is to have them both running on the same server. This is what I have done:
- Install php4 as a module (this was already done for me).
- Download and install PHP5 as a CGI
./configure --prefix=/usr/local --with-mysql=/usr/lib/mysql/ --enable-soap
make
make install
- Configure apache
ln -s /usr/local/bin/php /usr/local/apache/cgi-bin/php5
- enable mod_actions in httpd.conf
- inser the following in the httpd.conf:
<Directory "/usr/local/apache/htdocs/cms">
Options FollowSymLinks +ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AddHandler php-script .php
Action php-script /cgi-bin/php5
</Directory>
The idea is that now I should be able to simply use <Directory> entries to tell apache which directories to parse with PHP5. Directories that I don't explicitly tell apache to use php5, it will default back to mod_php4. So I created a test.php file inside the cms directory (as specified by the directive above) the test file only contains the <?php phpinfo(); ?> line to show me the php config status. But it doesnt work. I get the following message:
Forbidden
You don't have permission to access /cgi-bin/php5/cms/test.php on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.33 Server at www.mysite.org Port 80
I checked my apache error_log and this is what I get:
"[error] [client 65.89.63.115] Premature end of script headers:
/usr/local/bin/php"
I thought that it may have been a case that PHP5 was not installed properly but I ran the following command in shell:
/usr/local/bin/php /usr/local/apache/htdocs/cms/test.php
and it returns the complete HTML code that the phpinfo function is supposed to return on the browser so I know that php5 has been installed properly. I am thinking that there is something as far as permissions through apache that I am missing. Is there anything else that I should be adding to the DIRECTORY directive in the apache httpd.conf file?
I really do not know what the problem is here and I need to get this working. I would really like some help with this. any advice would really be appreciatted.
thanx!