Guldasta (A bouquet of flowers)

… because life is about varied experiences

  • Subscribe

  • Blog Stats

    • 37,599 hits
  • Disclaimer

    All which I express here are my independent views/opinions and are not necessarily influenced by any organization I work/correspond with.

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.

Advertisements

2 Responses to “httpd/apache not parsing php”

  1. 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

  2. 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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: