LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-09-2008, 10:34 AM   #1
orsty9001
Member
 
Registered: Mar 2008
Distribution: Slackware, Mint, Raspbian
Posts: 71

Rep: Reputation: 1
Yesterday PHP worked just fine and today it wants to serve up the php code.


I'm using Slackware 12 and Apache. Yesterday everything was working fine. It was just happy serving up php webpages and today it wants to serve up the source code to some browsers and others it wants to let the download the php file. I cannot figure out what's changed from yesterday to today. Nothing in the logs, no resets nothing. Even tried copying my backed up httpd.conf file and resetting my webserver this morning and still wants to do the same thing.

Any suggestions on how to get this back to normal?
 
Old 12-09-2008, 10:44 AM   #2
lmaza
LQ Newbie
 
Registered: Dec 2008
Posts: 12

Rep: Reputation: 1
RE-Problem with PHP

Maybe the package responsable of php is now broken.



Quote:
Originally Posted by orsty9001 View Post
I'm using Slackware 12 and Apache. Yesterday everything was working fine. It was just happy serving up php webpages and today it wants to serve up the source code to some browsers and others it wants to let the download the php file. I cannot figure out what's changed from yesterday to today. Nothing in the logs, no resets nothing. Even tried copying my backed up httpd.conf file and resetting my webserver this morning and still wants to do the same thing.

Any suggestions on how to get this back to normal?
 
Old 12-09-2008, 11:10 AM   #3
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
Is the system allowed to update itself automatically?

You might try putting a php.ini file into the directory that holds the website. I have seen that work before when the symptoms you describe appeared.
 
Old 12-09-2008, 11:21 AM   #4
orsty9001
Member
 
Registered: Mar 2008
Distribution: Slackware, Mint, Raspbian
Posts: 71

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by jiml8 View Post
Is the system allowed to update itself automatically?

You might try putting a php.ini file into the directory that holds the website. I have seen that work before when the symptoms you describe appeared.

It's not set to update automatically. It's still Apache/2.2.4, nothing has changed as far as I can tell.

I've actually heard of that php.ini trick before also. Just tried it now since you suggested it and still keeps trying display the php source.
 
Old 12-10-2008, 01:46 AM   #5
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Not sure if it's the server. I have experienced this with firefox on ubuntu and some sites (like LQ).

It might be conditions on the network (in my case the isp / internet) and happens when my internet experience is 'slow'. Wait a few hours and it's OK again.
 
Old 12-10-2008, 08:46 AM   #6
orsty9001
Member
 
Registered: Mar 2008
Distribution: Slackware, Mint, Raspbian
Posts: 71

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Wim Sturkenboom View Post
Not sure if it's the server. I have experienced this with firefox on ubuntu and some sites (like LQ).

It might be conditions on the network (in my case the isp / internet) and happens when my internet experience is 'slow'. Wait a few hours and it's OK again.
I let it sit over night and still the same thing this morning. I'm going to try later to reinstall PHP.
 
Old 12-10-2008, 11:07 AM   #7
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
It has to be the server, without question. The client system only sees what is shipped to it, and the server should not be shipping the raw PHP code.

If this is a sudden change for no apparent reason, that suggests that perhaps a file has become corrupted. Before reinstalling PHP (which probably is a good choice), I think you might want to run fsck on the affected hard drive/partition.
 
Old 12-10-2008, 02:08 PM   #8
orsty9001
Member
 
Registered: Mar 2008
Distribution: Slackware, Mint, Raspbian
Posts: 71

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by jiml8 View Post
It has to be the server, without question. The client system only sees what is shipped to it, and the server should not be shipping the raw PHP code.

If this is a sudden change for no apparent reason, that suggests that perhaps a file has become corrupted. Before reinstalling PHP (which probably is a good choice), I think you might want to run fsck on the affected hard drive/partition.
Drive looks good, no errors. It's like Apache isn't sending the code to the PHP engine to be compiled.

I reinstalled php and upgraded Apache, still doing the same thing. I've found where this has happened a couple of other times on google in other forums. It's really got me stuck.
 
Old 12-11-2008, 10:18 AM   #9
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
I had the same problem appear, but it was on a server that hosts my website and my solution was to contact the hosting company and make them fix it. It happened as part of a major upgrade they were doing to the server, and IIRC they told me that putting a php.ini file in the root of my website solved the problem.

I have never experienced it on the servers I own, hence have never had to figure it out myself, and thus don't know the solution.

What happens when you try to invoke one of your pages from the command line? eg: php mypage.php

If you have command line PHP installed, you should get an html stream back. If you don't, this might be a clue for you.
 
Old 12-11-2008, 03:44 PM   #10
jstephens84
Senior Member
 
Registered: Sep 2004
Distribution: (Home)Opensolaris, Ubuntu, CentOS, (Work - AIX, HP-UX, Red Hat)
Posts: 2,054

Rep: Reputation: 83
This problem is due in part to Apache not loading the php module correctly and thus does not know how to handle php request. Look through your httpd.conf file for the following three statements. I know you said that nothing has changed but I would still ensure that they are there. Also try a reboot on the server. This has helped me before when I had the same problem.

LoadModule php5_module libexec/libphp5.so
AddType application/x-httpd-php .php
DirectoryIndex index.html index.php
 
Old 12-12-2008, 10:48 AM   #11
orsty9001
Member
 
Registered: Mar 2008
Distribution: Slackware, Mint, Raspbian
Posts: 71

Original Poster
Rep: Reputation: 1
When I invoke it from the command line it processes the PHP code. It produces the html that should be sent to the browser which makes me suspect apache.

Also jstephens84, those lines are in httpd.conf. That was the first thing I checked.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
php page displaying text that is supposed to be part of php code DragonM15 Programming 9 07-31-2008 04:58 PM
USB Devices Fail To Mount - They Worked Fine Yesterday rrrssssss Suse/Novell 22 09-25-2007 01:04 PM
ipodder worked yesterday not today pennyg Linux - Desktop 1 11-07-2006 01:31 PM
DOOM3 worked yesterday, doesn't today NetRAVEN5000 Linux - Games 9 10-22-2005 06:25 PM
startx -- :1.0 worked yesterday but today.. slackist Linux - General 3 05-12-2005 10:35 AM


All times are GMT -5. The time now is 05:53 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration