[SOLVED] PHP File gets Downloaded instead of Showing the configuration
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 !!
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 !!
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 ....
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 ....
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 .
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 ....
You linked to a page of mirrors for the source tarball. Compile it first. *nod*
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.
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 ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.