View Full Version : php Files Not Parsing (Trying to download instead of display)
roger
2011-01-28, 03:57 PM
I just set up my account and am in the process of getting things figured out. I uploaded an index.php file to test the server, and it is trying to download the file rather than display it. An html file displays just fine. From my experience setting up servers this usually indicates an error with the httpd.conf file, but it seems to be setup correctly, i.e.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Any other suggestions?
roger
2011-01-28, 04:47 PM
So apparently I was trying to upload files to high up on the server, when I uploaded a php file under /var/www/vhosts/domain.name/httpdocs/ and clicked the preview site link it works ok. I apparently confused the public documents shown on Plesk for the web site files.
arunr
2011-10-15, 03:16 AM
I installed php5 on ubuntu lucid lynx 10.04 by following the instructions at
https://help.ubuntu.com/community/ApacheMySQLPHP
I already had apache2 server running on my machine, so I installed only PHP5 and mySQL 5 using
sudo apt-get install php5-mysql libapache2-mod-php5 mysql-server
(During the installation, the apache2 server I already had on my machine was stopped and re-started.)
I faced the same issue with my php files - they were downloading, instead of being parsed by apache. Googled around and found your post.
Then I followed the guidelines at https://help.ubuntu.com/community/ApacheMySQL (https://help.ubuntu.com/community/ApacheMySQLPHP) under section titled 'Checking PHP 5 installation' and did all the testing recommended there.
I tried this command suggested there:
sudo a2enmod php5
and it said "Module php5 already enabled".
Finally I tried re-starting apache2 with the following command:
sudo apache2ctl restart
and PHP started parsing and working fine after that.
So most likely your apache server needs a re-start too!
suwunk
2011-10-16, 09:58 PM
Thanks for sharing the solution with us!
I installed php5 on ubuntu lucid lynx 10.04 by following the instructions at
https://help.ubuntu.com/community/ApacheMySQLPHP
I already had apache2 server running on my machine, so I installed only PHP5 and mySQL 5 using
sudo apt-get install php5-mysql libapache2-mod-php5 mysql-server
(During the installation, the apache2 server I already had on my machine was stopped and re-started.)
I faced the same issue with my php files - they were downloading, instead of being parsed by apache. Googled around and found your post.
Then I followed the guidelines at https://help.ubuntu.com/community/ApacheMySQL (https://help.ubuntu.com/community/ApacheMySQLPHP) under section titled 'Checking PHP 5 installation' and did all the testing recommended there.
I tried this command suggested there:
sudo a2enmod php5
and it said "Module php5 already enabled".
Finally I tried re-starting apache2 with the following command:
sudo apache2ctl restart
and PHP started parsing and working fine after that.
So most likely your apache server needs a re-start too!