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?
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.
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.
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!
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.