Results 1 to 5 of 5

Thread: Apache not executing .php files, directly downloads it

  1. #1
    Join Date
    Oct 2010
    Posts
    53

    Apache not executing .php files, directly downloads it

    I have recently installed the Linux Mint 10 and an Apache Server. I am working on my own website and I have copied my files to /var/www. Now the problem is when I am trying to navigate my website then .php files gets downloaded instead of getting executed. Apache is displaying them as they are pure HTML files but while submitting the form, It starts downloading. So it is for sure that the server is working properly. I have installed libapache2-mod-php5. Can you guys give me some idea due to what, Such problems are arriving?

  2. #2
    Join Date
    Nov 2009
    Posts
    1,340

    Re: Apache not executing .php files, directly downloads it

    Most probably it seems like you have not configured the PHP properly due to which they are just getting downloaded when you click on event. I think you should try configuring it again and then check that PHP files runs or not. Actually sometime it happens that the files that you wish to run are not compatible with an environment that you have created.

  3. #3
    Join Date
    Nov 2009
    Posts
    1,191

    Re: Apache not executing .php files, directly downloads it

    Problem could be with the browser as it is not necessary that all the browser would be showing you the same result. I suggest you to try running the same webpage from some other browser. It might happen that the same PHP start executing on some other browser as there could be some plug in on your current browser which be stopping php to run.

  4. #4
    Join Date
    Apr 2010
    Posts
    90

    Re: Apache not executing .php files, directly downloads it

    I installed Apache 2, PHP, MySQL, but I can not use the documents. Php. In the example below, the file test.php located in the Sites folder of my home folder. I do not understand what is happening. When I open the file in Safari or Firefox with the command "127.0.0.1 / ~ xxx / test.php" xxx is my name director, I have the following error that appears.

    Not Found
    The requested URL / ~ Eric / test.php was not found on this server.
    Apache/2.0.52 (Unix) PHP/4.3.9 DAV / 2 Server at 127.0.0.1 Port 80

    Web sharing is turned off in prefs "sharing." Well, I have not found a solution. Thank in advance!

  5. #5
    Join Date
    Nov 2009
    Posts
    712

    Re: Apache not executing .php files, directly downloads it

    Several avenues to attempt to operate:
    • I guess that test.php is at / Users / Eric / Sites / test.php
    • should enable Web Sharing in the preferences (unless you do not start Apache manually)
    • must verify that php is enabled in Apache * (skipping a few comments)

    To test the first point, you can simply try the url http: //localhost/ ~ Eric / (note the last / is important). You should see the home page 'X'. Points for the last many links exist to enable php in apache.

Similar Threads

  1. Executing exe files in Ubuntu
    By Benjhonson in forum Operating Systems
    Replies: 3
    Last Post: 27-12-2010, 02:20 AM
  2. Apache Binary files missing on Mac
    By Trini Alvarado in forum Networking & Security
    Replies: 6
    Last Post: 05-05-2010, 10:25 AM
  3. Flv files not executing on k-lite
    By CAILYN in forum Windows Software
    Replies: 3
    Last Post: 01-12-2009, 09:31 PM
  4. Webserver is not executing CGI files.
    By Gill_christ in forum Software Development
    Replies: 2
    Last Post: 01-05-2009, 12:32 PM
  5. Unable to copy files to Apache server
    By Azzan in forum Networking & Security
    Replies: 4
    Last Post: 08-04-2009, 01:04 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
  •