Koozali.org: home of the SME Server

yum Update broke PHP.. Help Please

Offline Mjohnson

  • *
  • 172
  • +0/-0
yum Update broke PHP.. Help Please
« on: November 28, 2005, 10:51:24 PM »
I am running SME 6.01... I performed a Yum update yesterday.  Since then my web applications coupling PHP and MySQL are broken.  MySQL is functioning fine but the web sites (GeekLog and PHPBB) are broken.

I performed the following:

yum update
which found a Yum Update,

I then installed:
yum update yum  
/sbin/e-smith/signal-event post-upgrade
/sbin/e-smith/signal-event reboot

...and then PHP was broken. The messages log is filled with PHP Fatal Error lines.  Also a PHP error was reported during reboot.  

I am hoping this is something obvious to correct.  I have searched around the site and forums but have not found anything quite like this problem.  

Suggestions?  Help??  

Thanks
......

boss_hog

yum Update broke PHP.. Help Please
« Reply #1 on: November 29, 2005, 01:40:44 AM »
Hey Mjohnson,
it would be very helpful if you gave us some examples of the errors,
 a portion of the log or logs.
Then we can help troubleshoot where the problem is.
Thanks
Joe

Offline Mjohnson

  • *
  • 172
  • +0/-0
yum Update broke PHP.. Help Please
« Reply #2 on: November 29, 2005, 04:04:38 AM »
Thanks Joe...  Here are some log samples:

On Reboot, the following entry shows up:

Quote
Nov 28 15:24:32 cosmo httpd: PHP:  Error parsing /etc/php.ini on line 59


The php.ini line 59 is:

Quote
session.save_path   = /tmpfile_uploads  = On


The log file then shows the following in response to a request to the web server for the various pages:

Quote
Nov 27 23:23:26 cosmo httpd: PHP Fatal error:  Call to undefined function:  mysql_connect() in /home/e-smith/files/ibays/fawebsite/html/geeklog/system/databases/mysql.class.php on line 112
Nov 27 21:44:13 cosmo httpd: PHP Fatal error:  Call to undefined function:  mysql_connect() in /home/e-smith/files/ibays/faforum/html/db/mysql4.php on line 48
Nov 27 23:46:10 cosmo httpd: PHP Fatal error:  Call to undefined function:  mysql_connect() in /home/e-smith/files/ibays/fawebsite/html/geeklog/system/databases/mysql.class.php on line 112
Nov 27 21:46:21 cosmo httpd: PHP Fatal error:  Call to undefined function:  mysql_connect() in /home/e-smith/files/ibays/faforum/html/db/mysql4.php on line 48
Nov 27 21:46:22 cosmo httpd: PHP Fatal error:  Call to undefined function:  mysql_connect() in /home/e-smith/files/ibays/fiscforum/html/db/mysql4.php on line 48
Nov 27 21:46:24 cosmo httpd: PHP Fatal error:  Call to undefined function:  mysql_connect() in /home/e-smith/files/ibays/fiscforum/html/db/mysql4.php on line 48


The PHP Fatal error, in all cases, refers to the following line:

Quote
$this->db_connect_id = ($this->persistency) ? mysql_pconnect($this->server, $this->user, $this->password) : mysql_connect($this->server, $this->user, $this->password);


Hope this offers some explanation....

Thanks

Mike
......

boss_hog

yum Update broke PHP.. Help Please
« Reply #3 on: November 29, 2005, 05:57:11 AM »
Hey Mjohnson,
line 59 of php.ini looks suspicious.
The "= On" after "/tmp_uploads" doesn't look right.
I compared my 2 SME server php.ini files
and they both have the "session.save_path = /tmp".

One of the boxes is SME6.5rc1 the other is SME7b8. They both have installations of php powered sites
on each machine.
It looks like your install, PHP needed a temp directory
 to upload to?

Do you have any custom templates for making
adjustments to the php.ini file installed?
Good luck.
Joe

boss_hog

yum Update broke PHP.. Help Please
« Reply #4 on: November 29, 2005, 06:04:20 AM »
Hey Mjohnson,
after a closer look, your php.ini
file has merged 2 lines into 1.
I think it should read:
session.save_path = /tmp
and
file_uploads = On

Check to see if you have a damaged custom template
 that is writing these lines incorrectly.
Joe

Offline Mjohnson

  • *
  • 172
  • +0/-0
yum Update broke PHP.. Help Please
« Reply #5 on: November 29, 2005, 06:12:40 AM »
Hi Joe...
Good Catch...  I agree with your diagnosis.

So how do I modify the line??  It appears to be influenced by a custom template.  That is where I start to do things by rote rather than savy..
......

Offline Mjohnson

  • *
  • 172
  • +0/-0
yum Update broke PHP.. Help Please
« Reply #6 on: November 29, 2005, 06:22:00 AM »
Joe,

I checked the custom template directory and the template directory.  They seem to be correct with your recommendation.  

hmmm..  

Anything additional information I can get you to assist in the solution?

Mike
......

Offline Mjohnson

  • *
  • 172
  • +0/-0
yum Update broke PHP.. Help Please
« Reply #7 on: November 29, 2005, 06:36:55 AM »
Joe,

I manually rewrote the lines as you suggested and did a reboot.  The sites are currently functioning just fine, as before.

I am concerned as to the source of the problem.  This is one of those times I really didn't take any risky steps I thought were, shall I say, disatrous so I am concerned as to the source of the problem.

I am going to call it night now.  Looks like things are on the right path..  Thanks.

Mike
......

boss_hog

yum Update broke PHP.. Help Please
« Reply #8 on: November 29, 2005, 04:33:01 PM »
Hey Mjohnson,
when you rewrote the lines, did you repair a custom template or did you just correct the php.ini file directly?

If you make changes to the php.ini directly, your changes *will not* survive an upgrade/update-event.
If on the other hand, you found a custom template and made the repairs to it, all *should* be fine.

No, this doesn't help figure out why the template got messed up in the first place.
1) Did you recently add any new rpm's or apps?
2) Are you the only admin on this machine?
3) Were you seeing any odd behavior before the update?

If you suspect there is a bug here, try to document what lead up to the problem: log files, added rpms, new apps etc.
Then post a bug in Bugzilla(or bugtracker).
Good luck
Joe

Side Note: it may be worth the risk to try doing a "/sbin/e-smith/signal-event post-upgrade"
then,
"/sbin/e-smith/signal-event reboot".
If the php.ini file stays working everything should be fine.
Might be better off finding out now if the problem is going to persist.

Offline Mjohnson

  • *
  • 172
  • +0/-0
yum Update broke PHP.. Help Please
« Reply #9 on: November 29, 2005, 07:06:23 PM »
Joe,

Got it!!

I did the signal-event post upgrade and reboot as you suggested.  The manual php.ini changes were over written, just as you expected.  I started digging into the Custom Templates for php.ini.  There was only one listed in the directory named "50PathsDirectories".  Just for hoots I renamed it to "55PathsDirectories" and upgraded and rebooted...no change.

I then opened the file, which had the following contents:
Quote
include_path        = ".:/usr/share/pear"
doc_root            =
user_dir            =
extension_dir       = /usr/lib/php4
enable_dl           = On
session.save_path   = /tmp

I added a C/R to the end of the last line...upgraded and rebooted one more time and wouldn't you know, problem solved!!

Thanks for your assistance.  Your help was invaluble!!

You Da Man!!!!!!!!

Mike
......