PHP File gets Downloaded instead of Showing the configuration
well i have everything installed on my LAMP .. the apache2.4.2 is running and php5 too is installed ....
But the problem is that when i am running my http://localhost/test.php the browser shows me the code written in the test.php as : <?php phpinfo(); ?>... I have AddType application/x-httpd-php .php in my httpd.conf file also but this does not seem to work !! What could be the problem and related solution. Thanks in advance !! |
did u restart ur apache after installing php?? seems php has not been detected by the webserver. kindly give more details so that it ll be easy to understand the issue. for instance how did u install LAMP? is it from repo or binaries like bitnami??
|
@pabhampm : yes i restarted Apache after installing php but the file is not giving me the configuration details : instead it is showing me the file contents .... I installed all LAMP contents by basically downloading and unzipping the contents of .tar.gz packages !!
|
Which OS are you using? What packages did you install for PHP?
|
It looks like you haven't loaded the libphp5.so module in your apache web server, but anyhow please provide us with more details such as, what linux distro you're running, why not installing LAMP through distro's package manager (if any) etc...
anyhow this is Arch Linux specific ( => https://wiki.archlinux.org/index.php/LAMP#PHP ), but should point you how to load the php module in apache. do not forget to reload the webserver for the change to take effect. |
Which distro are you using? tar.gz packages are usually source packages. It sounds like your Apache is running on a Linux, which is a good start, but it's obviously not configured right for php. Are you going to be running php as a module or as a CGI interpreter?
|
i am using Linux Mint 13 "Maya" - Cinnamon (32-bit) and i used the php available here : http://www.php.net/get/php-5.4.4.tar.gz/from/a/mirror ....and basically i am a newbie and i am trying my hands on LAMP and main motive is to run basic php programs though this ....
|
Quote:
|
yes i did refer to it but as i mentioned i am already done with every part of the installation the only thing that's creating the problem is : " The php file shows me the content " i.e it is not getting Parsed i guess .
|
Quote:
|
it was this link : http://in3.php.net/get/php-5.4.4.tar...php.net/mirror
|
Right... and presuming you compiled it correctly, running `php -v` at a prompt should show you some version information.
If not, then it's probably not actually installed. Beyond that, it could be that Apache or php was compiled with the wrong MTM -- or most likely that Apache is just configured wrong. Try adding "LoadModule php5_module modules/libphp5.so" to your httpd.conf file. The path might be wrong, but it's a start. Also check your logs for errors. |
running php -v gives : PHP 5.3.10-1ubuntu3.1 with Suhosin-Patch (cli) (built: May 4 2012 02:21:57)
Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies That means its installed ...right ?? LoadModule php5_module modules/libphp5.so is also present in httpd.conf |
Okay. The php 5.4.4 file you downloaded isn't the one you're using. You're running the Ubuntu version which seems to be 5.3.10 -- try this link:
https://help.ubuntu.com/community/ApacheMySQLPHP |
yeah out of this frustration i used sudo apt-get install php5 which in turn installed PHP 5.3.10 ..... but hey now the error changed and its showing me 404 for my test.php ...
|
Your Apache is probably still not set up... make sure test.php is in the DocumentRoot directory specified in httpd.conf -- that's usually what does that.
|
yeah now going for it !!
tasksel seems to be the only way for this mess ...Tasksel Installing packages |
it is in /usr/local/apache2/htdocs as specified in DocumentRoo of httpd.conf
|
the problem persists it shows me the "404 not found " error for localhost/test.php ....
|
Quote:
thanks! |
All times are GMT -5. The time now is 12:52 AM. |