Change your PHP handler from mod_php (DSO) to suPHP

Finally, I decided to change my server’s PHP handler to suPHP from mod_php. It’s more secure and I can update my plugins and WordPress files automatically without annoying permission errors.

Here’s what my php config looks like after the update:

 

php.conf updated to:

# This file was automatically generated by the Cpanel PHP Configuration system
# If you wish to change the way PHP is being handled by Apache on your system,
# use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
#
# Manual edits of this file will be lost when Apache is updated.


# SuPHP configuration for PHP5
LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine on
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

    suPHP_AddHandler application/x-httpd-php5


# End of autogenerated PHP configuration.


Updating user configurable PHP settings.
[info] recursion depth is set to: 2
Restarting Apache

Now, I can update WordPress hassle free!

To change your php handler, you should have WHM root access. This is the only way I know. I think you can change it via SSH, but I haven’t tried it yet.

Once you’re logged in as root, just go to Service Configuration > Configure PHP and SuExec > Alter Configuration > PHP 5 Handler > Select suPHP.

Once you’ve selected suPHP, just click “Save New Configuration”.

That’s it!


Comments

8 responses to “Change your PHP handler from mod_php (DSO) to suPHP”

  1. Hi Brian, Thanks for the info. Just what I was looking for to get my WordPress plugins auto update working on my server.

  2. Bryan Veloso Avatar
    Bryan Veloso

    Hi Angela, I’m glad my post helped.

  3. […] If you can update your files automatically, then we have the same problem and I have a solution for your problem! Just convert your server’s php handler to suPHP from mod_php! […]

  4. Would you please show the steps of how I can change my server’s PHP handler to suPHP from mod_php. My server has c-panel 2.

    Thanks in advance.

  5. Bryan Veloso Avatar
    Bryan Veloso

    @Meezan Rahman – you can update your server’s PHP handler to suPHP from mod_php if you have WHM access.

    Just go to Service Configuration > Configure PHP and SuExec > Alter Configuration > PHP 5 Handler > Select suPHP.

    Once you’ve selected suPHP, just click “Save New Configuration”.

  6. i m confused probably I am new to wordpress and got this error recently …

    1. Bryan Veloso Avatar
      Bryan Veloso

      What error did you get?

  7. […] The answer is simple. If your php handler is mod_php or DSO, then you can increase the memory allocation by yourself by updating your PHP.ini. PHP.ini files won’t work in server with mod_php (DSO) as their php handlers. You need to change your PHP handler from mod_php to suPHP. […]

Leave a Reply

Your email address will not be published. Required fields are marked *

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