LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 06-17-2012, 04:13 AM   #1
abhiionweb
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Rep: Reputation: Disabled
Unhappy 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 !!
 
Old 06-17-2012, 05:17 AM   #2
prabampm
LQ Newbie
 
Registered: Jun 2012
Posts: 4

Rep: Reputation: Disabled
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??
 
Old 06-17-2012, 09:16 AM   #3
abhiionweb
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
@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 !!
 
Old 06-17-2012, 09:23 AM   #4
Zetec
Member
 
Registered: Jul 2006
Distribution: Debian, Ubuntu, W7, openSUSE, Centos
Posts: 152

Rep: Reputation: 25
Which OS are you using? What packages did you install for PHP?
 
Old 06-17-2012, 09:24 AM   #5
rosehosting.com
Member
 
Registered: Jun 2012
Location: Missouri, USA
Posts: 236

Rep: Reputation: 64
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.
 
Old 06-17-2012, 09:28 AM   #6
headrift
Member
 
Registered: Sep 2005
Distribution: Gentoo, Sabayon, Puppy, Arch
Posts: 165

Rep: Reputation: 29
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?
 
Old 06-17-2012, 12:03 PM   #7
abhiionweb
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
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 ....
 
Old 06-17-2012, 12:05 PM   #8
rosehosting.com
Member
 
Registered: Jun 2012
Location: Missouri, USA
Posts: 236

Rep: Reputation: 64
Quote:
Originally Posted by abhiionweb View Post
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 ....
Try with this => https://www.google.com/search?sugexp...x+mint+13+LAMP
 
Old 06-17-2012, 12:11 PM   #9
abhiionweb
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
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 .
 
Old 06-17-2012, 12:34 PM   #10
headrift
Member
 
Registered: Sep 2005
Distribution: Gentoo, Sabayon, Puppy, Arch
Posts: 165

Rep: Reputation: 29
Quote:
Originally Posted by abhiionweb View Post
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*
 
Old 06-17-2012, 12:43 PM   #11
abhiionweb
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
it was this link : http://in3.php.net/get/php-5.4.4.tar...php.net/mirror
 
Old 06-17-2012, 12:51 PM   #12
headrift
Member
 
Registered: Sep 2005
Distribution: Gentoo, Sabayon, Puppy, Arch
Posts: 165

Rep: Reputation: 29
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.
 
Old 06-17-2012, 01:11 PM   #13
abhiionweb
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-17-2012, 01:15 PM   #14
headrift
Member
 
Registered: Sep 2005
Distribution: Gentoo, Sabayon, Puppy, Arch
Posts: 165

Rep: Reputation: 29
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.
 
Old 06-17-2012, 01:20 PM   #15
abhiionweb
LQ Newbie
 
Registered: Jun 2012
Posts: 15

Original Poster
Rep: Reputation: Disabled
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 ...
 
  


Reply

Tags
apache2, lamp, php5



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] problems with PHP, showing code trying to "run" a php file? michaelinux Slackware 1 12-29-2010 10:21 PM
php to confirm a file was downloaded from server blizunt7 Programming 2 09-16-2008 02:34 AM
PHP won't recognize my Configuration File (php.ini) path kriezo Programming 4 02-14-2008 02:31 AM
Problem with PHP Configuration File? ShaqDiesel Linux - Server 3 11-15-2007 12:25 PM
downloaded apache +RH mysql + RH php would it work? Red Squirrel Linux - Software 1 03-07-2004 06:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration