Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
06-17-2012, 04:13 AM
|
#1
|
|
LQ Newbie
Registered: Jun 2012
Posts: 15
Rep: 
|
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 !!
|
|
|
|
06-17-2012, 05:17 AM
|
#2
|
|
LQ Newbie
Registered: Jun 2012
Posts: 4
Rep: 
|
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??
|
|
|
|
06-17-2012, 09:16 AM
|
#3
|
|
LQ Newbie
Registered: Jun 2012
Posts: 15
Original Poster
Rep: 
|
@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 !!
|
|
|
|
06-17-2012, 09:23 AM
|
#4
|
|
Member
Registered: Jul 2006
Distribution: Debian, Ubuntu, W7, openSUSE, Centos
Posts: 152
Rep:
|
Which OS are you using? What packages did you install for PHP?
|
|
|
|
06-17-2012, 09:24 AM
|
#5
|
|
Member
Registered: Jun 2012
Posts: 192
Rep:
|
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.
|
|
|
|
06-17-2012, 09:28 AM
|
#6
|
|
Member
Registered: Sep 2005
Distribution: Gentoo, Sabayon, Puppy, Arch
Posts: 165
Rep:
|
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?
|
|
|
|
06-17-2012, 12:03 PM
|
#7
|
|
LQ Newbie
Registered: Jun 2012
Posts: 15
Original Poster
Rep: 
|
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 ....
|
|
|
|
06-17-2012, 12:11 PM
|
#9
|
|
LQ Newbie
Registered: Jun 2012
Posts: 15
Original Poster
Rep: 
|
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 .
|
|
|
|
06-17-2012, 12:34 PM
|
#10
|
|
Member
Registered: Sep 2005
Distribution: Gentoo, Sabayon, Puppy, Arch
Posts: 165
Rep:
|
Quote:
Originally Posted by abhiionweb
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*
|
|
|
|
06-17-2012, 12:43 PM
|
#11
|
|
LQ Newbie
Registered: Jun 2012
Posts: 15
Original Poster
Rep: 
|
|
|
|
|
06-17-2012, 12:51 PM
|
#12
|
|
Member
Registered: Sep 2005
Distribution: Gentoo, Sabayon, Puppy, Arch
Posts: 165
Rep:
|
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.
|
|
|
|
06-17-2012, 01:11 PM
|
#13
|
|
LQ Newbie
Registered: Jun 2012
Posts: 15
Original Poster
Rep: 
|
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
Last edited by abhiionweb; 06-17-2012 at 01:15 PM.
|
|
|
|
06-17-2012, 01:15 PM
|
#14
|
|
Member
Registered: Sep 2005
Distribution: Gentoo, Sabayon, Puppy, Arch
Posts: 165
Rep:
|
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
Last edited by headrift; 06-17-2012 at 01:17 PM.
|
|
|
|
06-17-2012, 01:20 PM
|
#15
|
|
LQ Newbie
Registered: Jun 2012
Posts: 15
Original Poster
Rep: 
|
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 ...
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:05 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|