libgcc_s.so.1 must be installed for pthread_cancel to work — cPanel Apache error

The other day I ran into the error “libgcc_s.so.1 must be installed for pthread_cancel to work.” Apache on this cPanel server would produce “Internal Server 500” for any web page. When I checked the /usr/local/apache/logs/error_log, I found the following entry:

[Thu Jul 17 03:51:41 2014] [error] [client 12.34.56.78] libgcc_s.so.1 must be installed for pthread_cancel to work
[Thu Jul 17 03:51:41 2014] [error] [client 12.34.56.78] Premature end of script headers: index.php
[Thu Jul 17 03:51:42 2014] [error] [client 12.34.56.78] libgcc_s.so.1 must be installed for pthread_cancel to work
[Thu Jul 17 03:51:42 2014] [error] [client 12.34.56.78] Premature end of script headers: index.php
[Thu Jul 17 03:51:42 2014] [error] [client 12.34.56.78] libgcc_s.so.1 must be installed for pthread_cancel to work

The fix was only a Google search away. cPanel’s own forum had the fix here. I’ve consolidated the fix into a short shell script that you can just copy and paste. But first, understand what it does. In WHM, you can go to Home » Service Configuration » Apache Configuration » Memory Usage Restrictions and setup Resource Limits (RLimitMEM and RLimitCPU) to, well, limit CPU and memory resources.

The problem comes when sometimes, it doesn’t work as intended. So, you have to remove it. The easiest way is to edit /usr/local/apache/conf/httpd.conf, remove or comment out the RLimit lines, distill it and restart Apache. That’s what this script does, using sed to make the edit. It’s faster and it’s more precise, and it’s reversible (since I only commented out the lines rather than remove them.)

sed -i 's/^RLimit/#RLimit/g' /usr/local/apache/conf/httpd.conf
/usr/local/cpanel/bin/apache_conf_distiller --update
service httpd restart

You only need to log in to a shell prompt as root, and paste in the script. Make sure to press Enter after the “service httpd restart” to make sure Apache restarts. This should eliminate the error “libgcc_s.so.1 must be installed for pthread_cancel to work”.

Did this fix work for you? Share it with your friends using the link below, and leave a comment and let me know!

2 comments

    • Dennis on September 16, 2014 at 12:13 pm
    • Reply

    Thank you so much! I have been at this for hours and your script works flawlessly!
    Glad it is over and thanks so much for sharing.

    Dennis

    1. Excellent! I’m glad to hear it.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.