Main Tutorials

PhP file display as downloading instead of interpreted by Apache

Problem

While accessing the PHP file, it display as “application/x-httpd-php” downloading instead of interpreted properly by Apache. See figure below :

php-display-downloading

Solution

The PHP downloading issue is caused by the Apache didn’t load the PHP module properly.

1. Find and edit Apache configuration file, which should be able to find at $APACHE_PATH/conf/httpd.conf.

2. Make sure following lines are existed in httpd.conf, and point to correct PHP module location, of course 🙂


#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL
PHPIniDir "C:/PHP/"
LoadModule php5_module "C:/PHP/php5apache2_2.dll"
#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

3. Restart it, Done.

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
1 Comment
Most Voted
Newest Oldest
Inline Feedbacks
View all comments
Vered
12 years ago

Thanx, that’s exactly what I needed!