PHP Startup: Unable to load dynamic library

Discussion in 'Server Stuff' started by Mun, May 23, 2014.

  1. Mun

    Mun Administrator

    In my case I recently upgraded a few of my servers to Debian Wheezy from Debian Squeeze. Soon I noticed an influx of emails that kept spamming me over and over again. They look roughly like this:


    Subject:

    Cron <root@fremont-ds1> [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -t

    Content:

    PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php5/20100525/suhosin.so’ – /usr/lib/php5/20100525/suhosin.so: cannot open shared object file: No such file or directory in Unknown on line 0

    So what does this mean, and why is it happening?

    Well what this is stating is the PHP startup application, in my case php5-fpm, isn’t able to load suhosin extension for PHP5. This is caused by the fact that suhosin is deprecated and really not that effective as it used to be. As such the Debian Wheezy repositories removed suhosin. This is caused by the fact that you didn’t chose to replace the configs when you upgraded.

    How do I fix? (assume a common PHP5 Setup on Debian Wheezy)

    Lets ssh into our server with a root account. ( You will need to know this info)

    enter command: (Debian, Ubuntu, Linux Mint)
    Code:
    
      cd /etc/php5/conf.d/ && ls
    
    enter command: (RHEL)
    Code:
      cd /etc/php.d
    
    Once you are there look at the output and compare it to the error. In my case it shows suhosin, as such I am going to move the suhosin file.
    Code:
      mv suhosin.ini ~/suhosin.ini
    
    After you have moved all the affected .ini files to ~/ then you should restart php.

    For php5-fpm:
    Code:
      service php5-fpm restart
    
    For Apache:
    Code:
      service apache2 restart
    
    Then you should be all done.


    Some side notes: This setup was tested on Debian Wheezy as of 4/16/2013, things may have changed since then. This was tested for an Nginx setup and an Apache based setup. This was also tested with normal repos, and dotdeb repo based servers. Things maybe different if you compiled your own version of PHP, Apache, Nginx, or other web server based software.


    If any major issue arises you can always revert this by going to:
    Code:
      cd /etc/php5/conf.d
    
      mv ~/suhosin.ini suhosin.ini
    
    Or REHL:
    Code:
      cd /etc/php.d
    
      mv ~/suhosin.ini suhosin.ini
    
    You may need to replace suhosin.ini with another module if you removed others.


    Best of luck :)


    Update: RHEL paths from Adduc @ LowEndTalk.com
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice