httpd/apache not parsing php
Posted by imdad on September 9, 2008
My .php files where not being parsed at the server and where being offered as download files at the remote browser. I googled the problem:
- enable php in apache
- httpd not parsing php
- apache not running php
I was redirected to various forums, helping with the appropriate config… But all was fine with my config, the AddType, AddHandler all were present in the httpd.conf and conf.d/php.conf files and also the appropriate php5 module was loaded.
Then i went my root folder, public_html, in my case (may be /var/www/html/ in your case).
There i listed all the files .. also the HIDDEN ones.
there was a .htaccess file … whose contents were:
AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4
I DELETED this file.
Atlast, the server was now parsing the php code.
Sateesh said
Hi,
I am also having the same problem. But still did not understand whats my problem.
I dont see anything in my browser when i open php file. It doesnt even print anything if i include echo statements in the php script.
Please help. Let me know, all the configurations required to get php parsed by Apache. I am learning PHP, MySQL, Apache now.
_sateesh
julian said
imdad, your post fixed it for me, i had a line in my apache2.conf file similar to AddHandler x-httpd-php .php4
it was AddHandler php-script .php4 .php
from my old php4 install. removing that line fixed everything.