Posts Tagged extensions

FreeBSD 8.1, Zend Optimizer, php52-extensions and the dreaded Segmentation Fault (Core Dumped)

So I haven’t slept in 43 hours, it’s been at least 10 years since I’ve pulled this kind of stunt before but as you know from my last blog post here my server blew up and then my lappy blew up, so lots and lots to keep me busy with.. Part of that fun was doing a brand new fresh OS install on my server, and getting everything working just as it was before is never a cakewalk.  Well it was looking like it was until I started seeing this little Segmentation Fault at the end of my php -v statement.  I mean not to mention the 5-6 hours I spent wresting with ZendOptimizer but that was resolved and wasn’t nearly as epic, nor as disappointing at the 20+ hours that went into figuring this god awful problem.

For whatever reason when php52-mysql or php52-pdo_mysql were installed there would always be a segmentation error in shell.  It didn’t affect the websites mind you, that ran fine but running anything with php through shell wasn’t not happening(there goes 1/2 my cron).  So what do I do? I hop on freenode, undernet and efnet and start asking around as well as googling my face off.  And man oh man there are a ton of reasons why this could be happening and trust you me I went through them all.. But the key problem with my problem solving was that I was looking in completely the wrong place.  You see early on I was convinced that this was a php problem.  Probably set that way as an impatient chap named GoMYSQL on #mysql on freenode quite quickly told me it was and to take my question out of his sacred and holy channel.  So for the next 30 hours or so I proceeded to rip the very fabric of php apart in search of what cuold be causing this.  I commented out everything in extensions.ini, in php.ini narrowing it all down to mysql.so or alternatively pdo_mysql.so caused the same problem.   There was talk about the order of the extensions in extensions.ini causing issue so I tried mysql.so in every single spot on that list to no avail, the only thing that made the seg fault go away was to comment out mysql.so itself but then that kind of left me without a slightly important piece of functionality.

Well guess the fuck what?  It isn’t a php issue at all, it is a problem with mysql55.  For whatever reason I installed mysql55 instead of mysql50(bigger is better right?) and whether it’s a conflict with mysql55 and Zend, or Zend, php52-mysql and mysql55, or all of the above and eaccelerator or what but having that version of mysql installed caused this whole mess in the first place.

So her I am, 43 hours later and probably at least a dozen pots of green tea, completely out of option I figure why the hell not try mysql50?  On this old server it’s a hell of a wait to deinstall and recompile but nothing else is working.  Lo and fucking behold the minute it’s up and php52-extentions and php52-mysql are recompiled along side all my worries dissapear.  No more zend seg faults, no more mysql.so seg faults nada, zip zilch.

And for whatever reason this will be the very first post/article anywhere offering this advice because everyone else is dealing with a php issue.  So if this is you, if you have just installed php52 and php52-mysql or php anything-mysql and you are seeing everything loading fine except for mysql.so causing a segmentation fault do yourself a big favor and check what version of mysql you have installed.   If you are running mysql55 and Zend, or eAccelerator and Zend and mysql or any combination of the bunch get rid of mysql55 and install mysql50.  After you’ve done that you’re going to need to recompile php52-mysql and/or php52-pdo_mysql(or whatever version of phpxx-mysql you’re running) and then go in and recompile php52-extensions.  After all that restart apache and go to sleep!

I know that’s exactly what I’m about to do

Tags: , , , , , , , , , , , , , ,

Nginx 502 errors, php problems, wordpress, oh my!

Well today is a glorious day as I finally managed to fix a problem that had been haunting my server for a month or so.  In the end it was a solution that I’ve been taught countless times as something I should be doing by default when upgrading php but alas my mind is not on of the more expensive models and so it rarely does what it should..

So it all started with a fairly minor issue I noticed in WordPress.   When I would try to load up the media gallery I would be greeted with a nice 502  Nginx error.  I’m sure if I wasn’t running nginx then it would have a blank white page or an apache error.  So naturally I started with the nginx error logs which didn’t lead to much.. Then I setup php to log all errors and again that didn’t lead me to much, finally however I monitored my httpd-error.log and this lovely message turned up:

[warn] (2)No such file or directory: Cannot reinit SSLMutex
/libexec/ld-elf.so.1: /usr/local/lib/php/20060613/gd.so: Undefined symbol “zend_parse_parameters_none”

After some asking around on irc I was told that it was definitely a php problem.  Nothing more specific than that, just a php problem.  There were a bunch of forum posts saying it might have something to do with fastCGI but all the suggestions had no effect.  However there was one forum I foudn that through a suggestion out there that lit up a light bulb in my brain.  That being that if php5-extensions isn’t recompiled and reinstalled when php is updated sometimes the fit hits the shan.  Sure enough I had upgrade php5 a while back, and then again since then but hadn’t bothered to recompile the extensions.  Hell I hadn’t even recompiled Zend or Eaccelerator which is pretty standard.

So long story slightly shorter, I went in deinstalled and cleaned up my php5-extensions, reinstalled it and viola, problem solved!!

Tags: , , , , , ,

Page optimized by WP Minify WordPress Plugin