Segmentation fault on certain WordPress pages on Ubuntu / Apache / PHP

Posted February 3, 2015 33.6k views

I’m getting reproducible errors when trying to access certain parts of a WordPress instance. This identical behavior occurs on two WordPress instances hosted on the same box.

The two actions that fail (and lead to an error page in Chrome (Error code: ERREMPTYRESPONSE), and an error logged on server) are:

  • Attempting to access the “General” settings page (/wp-admin/options-general.php)
  • Attempting to confirm the deletion of any plugin

Apache2 error.log:
[core:notice] [pid 9173] AH00052: child pid 9177 exit signal Segmentation fault (11)
[core:notice] [pid 9173] AH00052: child pid 9181 exit signal Segmentation fault (11)

Server Info:
Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-24-generic x86_64)

PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:10)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.3, Copyright (c) 1999-2014, by Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans

Please let me know what other information may be helpful. Thanks in advance.

  • Do you have any additional plugins installed in these Wordpress instances?

  • I have a few, one of the instances has the following list:

    • Akismet
    • Google Analytics by Yoast
    • Google Apps Login
    • ImageInject
    • Jetpack by
    • Maintenance
    • WP Retina 2x

    I’ve tried deactivating them all, but the error still occurs when no plugins are active.

    The other has more, haven’t tried deactivating them all on this one:

    • Akismet
    • Contact Form 7
    • Digg Digg
    • Disable Comments
    • Download Monitor
    • Enable Media Replace
    • Google Analytics by Toast
    • Google Apps Login
    • ImageInject
    • Maintenance
    • Membership
    • MyThemeShop Connect
    • Really Simple CAPTCHA
    • Regenerate Thumbnails
    • Remove Dashboard Access
    • Responsive Lightbox
    • UpdraftPlus - Backup/Restore
    • WordPress SEO
    • WP-Mail-SMTP
    • WP Retina 2x
    • WP Shortcode by MyThemeShop
    • WP Tab Widget

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
9 answers

I found a fix for this, it requires a patch update of libssh2-php. See this thread here:

apt-get source libssh2-php
cd php-ssh2-0.12/
apt-get build-dep php-ssh2
apt-get install build-essential fakeroot devscripts
patch -p1 < fix-segfault.patch 
rm fix-segfault.patch 
debchange -i
dpkg-buildpackage -b

Restarted my Droplet (you could probably just restart Apache) and it works now!

  • Thank you so much, it works!

    I have setup more than 5 VPS on DO with WordPress installed but I just got this problem happen with my last installation, very weird.

  • Thanks a lot! this totally fixed my issue.

  • Hey there, I am running a droplet server on ubuntu 16.04. I tried using this guide to fix my issues with wordpress site. When I enter the command “patch -p1 < fix-segfault.patch” I get the following error:

    can’t find file to patch at input line 4
    Perhaps you used the wrong -p or –strip option?

    The text leading up to this was:

    |Fix the segfault
    |— a/ssh2-0.12/ssh2fopenwrappers.c

    |+++ b/ssh2-0.12/ssh2fopenwrappers.c

    File to patch: Skip this patch? [y] y
    Skipping patch.
    1 out of 1 hunk ignored

    Any idea what I did wrong??

Thanks for your help Emily. Unfortunately after applying that patch, same issue seems to recur. The bug description really sounded like it was exactly my problem. Wonder if I’m doing something wrong applying the patch.

I did try restarting Apache, and also the entire box.

@emilyhorsman YOU are such a life saver.

Thank You so much! I was able to solve this issue that was getting me really frustrated after setting up ssh/wordpress on DigitalOcean.

@emilyhorsman - Thanks, this worked great.

I had followed this tutorial on secure updates, and had the same issue.

Be sure to sudo on the commands (if needed) – I also found that I just needed to restart Apache, not the droplet.

by Justin Ellingwood
WordPress is the most popular content management system (CMS) on the web currently. While WordPress can be a great way to manage you content, there are some very insecure configurations that are given throughout the internet. This article will cover how to set up secure updates and installations using SSH keys instead of FTP, which is an inherently insecure protocol.

@emilyhorsman: Found my error - was a a silly one. Thanks so much for your help!

you absolute legend this fixed and issue i was having with a script!!

After an entire day of trying to trace this down, no solutions worked. I eventually however turned Apache to debug level logging and immediately noticed hundreds of notices/warnings with Google’s mod_pagespeed for Apache trying to rewrite images from Jetpack’s Photon images.

I did a simple a2dismod pagespeed and immediately there were no more segmentation faults.

Have also noticed my sites are actually running faster now with mod pagespeed turned off.

There seems to be quite a few bug reports about pagespeed causing segmentation faults.

Not sure if its just modpagespeed or the combination of modpagespeed, wordpress and php .... but turned off now problem gone.

I am done with it for now and in the process of moving everything to Nginx now. Tracing faults on Apache always turns into a nightmare, with Nginx I can find errors in a few seconds to a minute. Already spent the last 6 weeks getting to know Nginx and it rocks and now going back to my Apache server to try and diagnose this segfault error felt like I was in a different world where I could not speak the language anymore.