Go Back   TechArena Community > Technology > Technology & Internet
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Apache not executing .php files, directly downloads it

Technology & Internet


Reply
 
Thread Tools Search this Thread
  #1  
Old 27-12-2010
Member
 
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?

Reply With Quote
  #2  
Old 27-12-2010
Member
 
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.
Reply With Quote
  #3  
Old 27-12-2010
Member
 
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.
Reply With Quote
  #4  
Old 27-12-2010
Member
 
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!
Reply With Quote
  #5  
Old 27-12-2010
Member
 
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.
Reply With Quote
Reply

  TechArena Community > Technology > Technology & Internet
Tags: , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Apache not executing .php files, directly downloads it"
Thread Thread Starter Forum Replies Last Post
Executing exe files in Ubuntu Benjhonson Operating Systems 3 27-12-2010 03:20 AM
Apache Binary files missing on Mac Trini Alvarado Networking & Security 6 05-05-2010 11:25 AM
Flv files not executing on k-lite CAILYN Windows Software 3 01-12-2009 10:31 PM
Webserver is not executing CGI files. Gill_christ Software Development 2 01-05-2009 01:32 PM
Unable to copy files to Apache server Azzan Networking & Security 4 08-04-2009 02:04 PM


All times are GMT +5.5. The time now is 02:03 PM.