LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-15-2009, 09:32 AM   #1
Ezplan
Member
 
Registered: Dec 2003
Location: MA
Distribution: CentOS 6.8 & 7, Linux Mint
Posts: 66
Blog Entries: 1

Rep: Reputation: 15
PHP stops working


Hi,

I'm running an office intranet on CentOS 5 with apache 2.2.3.
This AM it stopped processing php code. I just see the actual code echoed to the web page. I've restarted the server, the restarted the whole machine , problem still exists!

Any suggestions?

Thanks!
 
Old 01-15-2009, 09:38 AM   #2
jonavogt
LQ Newbie
 
Registered: Apr 2004
Location: Germany
Distribution: SUSE 9.2 Pro | Gentoo | Fli4l
Posts: 16

Rep: Reputation: 0
Have you run any (automatic) updates related to apache or php?

Last edited by jonavogt; 01-15-2009 at 09:40 AM. Reason: added automatic
 
Old 01-15-2009, 09:38 AM   #3
jax8
Member
 
Registered: Feb 2004
Location: Australia
Distribution: Ubuntu, Fedora 10
Posts: 632

Rep: Reputation: 31
You probably have not installed the apache-php module. This will allow apache to process php files. Can't remember the name exactly but do a search in your package manager.
 
Old 01-15-2009, 09:50 AM   #4
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Quote:
Originally Posted by Ezplan View Post
Hi,

I'm running an office intranet on CentOS 5 with apache 2.2.3.
This AM it stopped processing php code. I just see the actual code echoed to the web page. I've restarted the server, the restarted the whole machine , problem still exists!

Any suggestions?

Thanks!
At the prompt try typing "a2enmod php5 (or php4 if that's the case)" and see if that fixes your problem (make sure to stop and start apache.)

Last edited by rweaver; 01-15-2009 at 09:51 AM.
 
Old 01-15-2009, 10:20 AM   #5
Ezplan
Member
 
Registered: Dec 2003
Location: MA
Distribution: CentOS 6.8 & 7, Linux Mint
Posts: 66

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Thanks for all the quick responses!

"a2enmod ... " responds "command not found".

I've not run any updates, and nothing automatic as far as I know. I was tweaking the apache configuration via Webmin 1.4 last night just to have apache listen on an additional port to 80. I'm setting up eGroupware and wanted that accessed via a different port.

Just to be clear, all php based web pages were executing perfectly yesterday. Plain html pages are still rendering fine today, but displaying the php code, if any, on the web page.
 
Old 01-15-2009, 10:26 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by Ezplan View Post
Thanks for all the quick responses!

"a2enmod ... " responds "command not found".

I've not run any updates, and nothing automatic as far as I know. I was tweaking the apache configuration via Webmin 1.4 last night just to have apache listen on an additional port to 80. I'm setting up eGroupware and wanted that accessed via a different port.

Just to be clear, all php based web pages were executing perfectly yesterday. Plain html pages are still rendering fine today, but displaying the php code, if any, on the web page.
It sounds like the php module isn't getting loaded when Apache comes up. Webmin is a great tool...but nothing beats editing files by hand to make sure things like this don't happen.

Take a look around on your system, and see if there's a backup copy of your Apache config file(s). Diff the two, and see what's changed...
 
Old 01-15-2009, 11:02 AM   #7
Ezplan
Member
 
Registered: Dec 2003
Location: MA
Distribution: CentOS 6.8 & 7, Linux Mint
Posts: 66

Original Poster
Blog Entries: 1

Rep: Reputation: 15
Thanks TB0ne for the heads up!

I thought that php was statically compiled in the versions of apache > 2! Evidently NOT!
In reviewing the httpd.conf file directly I noticed that there was no LoadModule line for php, but there was a libphp5.so in /usr/lib/httpd/ modules!
So I manually added "LoadModule module_php5 modules/libphp5.so" to httpd.conf, restarted apache and voila!

The question was asked if I had updated apache or php. No, but yesterday I did update Webmin!!!! Then made the tweaks to my apache install! Then KABOOM!

Thanks again for all the help!
 
Old 01-15-2009, 12:30 PM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,623

Rep: Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964Reputation: 7964
Quote:
Originally Posted by Ezplan View Post
Thanks TB0ne for the heads up!

I thought that php was statically compiled in the versions of apache > 2! Evidently NOT!
In reviewing the httpd.conf file directly I noticed that there was no LoadModule line for php, but there was a libphp5.so in /usr/lib/httpd/ modules!
So I manually added "LoadModule module_php5 modules/libphp5.so" to httpd.conf, restarted apache and voila!

The question was asked if I had updated apache or php. No, but yesterday I did update Webmin!!!! Then made the tweaks to my apache install! Then KABOOM!

Thanks again for all the help!
No problem...glad I could help.
 
  


Reply



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
Ubuntu Feisty - Sound was working, but mysteriously stops working after reboot. woodsy934 Linux - Software 7 07-04-2011 06:39 PM
__attribute__ ((weak)) suddenly stops working / starts working ta0kira Programming 3 08-15-2007 11:31 AM
PHP XMLReader stops at bad character MicahCarrick Programming 3 06-07-2007 07:25 PM
"USB device stops working after a time" 'fix' stops cdrom device mount/readability adamben Slackware 6 04-18-2007 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:48 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