News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ian Selby's Blog:
Weird PHP Seg Faults & Custom Session Handlers
September 18, 2007 @ 10:27:00

In recent work, Ian Selby came across something odd - a setup where PHP was segfaulting without any real indication of where the error might be:

Starting to get a little frustrated, I took a peek at my error logs (/var/log/httpd/error_log for the unitiated), and discovered a wonderful message [about the segfault]. As any person scratching their head would do, I hit up google.. to no real avail. Just a bunch of php bug reports. So, what happened, and how did I fix it?

After searching through the code and narrowing down where it could be, the culprit looked like a custom session handler he was using. It uses MySQL to store the sesion information and, unfortunately, when Ian had compiled the server he didn't let PHP know about his unique setup.

His default installation was trying to use the default MySQL information (including the socket) to reach the database. Obviously failing, the server simply gave up and segfaulted. Thankfully, all it takes it a recompile with a few extra parameters and you're back in business.

0 comments voice your opinion now!
segfault custom session handler mysql default configure segfault custom session handler mysql default configure


blog comments powered by Disqus

Similar Posts

php|architect: Are We Losing LAMP?

PHPMac.com: Building and Installing Apache 2.2.2 and PHP 5.1.4 on Mac OS X 10.4.6

Martynas Jusevicius' Blog: Calculating great-circle distance in MySQL and Propel

Davey Shafik\'s Blog: Filtering & Escaping Cheat Sheet

DevShed: PHP, MySQL and the PEAR Database


Community Events





Don't see your event here?
Let us know!


laravel release symfony2 interview refactor framework introduction threedevsandamaybe series install api community unittest podcast language code testing list opinion developer

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework