Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    roger is offline Junior Member
    Join Date
    Jan 2011
    Posts
    2

    Default php Files Not Parsing (Trying to download instead of display)

    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.

    Code:
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    Any other suggestions?

  2. #2
    roger is offline Junior Member
    Join Date
    Jan 2011
    Posts
    2

    Default

    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.

  3. #3
    Join Date
    Oct 2011
    Posts
    1

    Default Restart apache

    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

    Code:
    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 under section titled 'Checking PHP 5 installation' and did all the testing recommended there.

    I tried this command suggested there:

    Code:
    sudo a2enmod php5
    and it said "Module php5 already enabled".

    Finally I tried re-starting apache2 with the following command:

    Code:
    sudo apache2ctl restart
    and PHP started parsing and working fine after that.

    So most likely your apache server needs a re-start too!

  4. #4
    suwunk is offline Super Moderator
    Join Date
    Aug 2010
    Posts
    1,081

    Default

    Thanks for sharing the solution with us!
    Quote Originally Posted by arunr View Post
    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

    Code:
    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 under section titled 'Checking PHP 5 installation' and did all the testing recommended there.

    I tried this command suggested there:

    Code:
    sudo a2enmod php5
    and it said "Module php5 already enabled".

    Finally I tried re-starting apache2 with the following command:

    Code:
    sudo apache2ctl restart
    and PHP started parsing and working fine after that.

    So most likely your apache server needs a re-start too!


 

Similar Threads

  1. display ads
    By PotsNPans in forum Showoff
    Replies: 2
    Last Post: 2012-06-01, 12:35 PM
  2. Download a Folder
    By kfperin in forum Troubleshooting
    Replies: 3
    Last Post: 2010-10-14, 03:49 PM
  3. Can't see my files
    By colpaarm in forum How-To
    Replies: 4
    Last Post: 2010-08-24, 01:53 PM
  4. No FTP Access To Wordpress Files
    By ticktock22 in forum Troubleshooting
    Replies: 1
    Last Post: 2010-04-05, 11:01 AM
  5. zip and download Joomla site
    By vdotmatrix in forum How-To
    Replies: 2
    Last Post: 2009-06-10, 12:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts