{"id":872,"date":"2012-10-17T02:17:39","date_gmt":"2012-10-17T08:17:39","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=872"},"modified":"2026-03-25T00:09:38","modified_gmt":"2026-03-25T06:09:38","slug":"converting-php-handler-from-dso-to-suphp-in-cpanel-servers","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/converting-php-handler-from-dso-to-suphp-in-cpanel-servers\/","title":{"rendered":"Converting PHP Handler from DSO to suPHP in cPanel Servers"},"content":{"rendered":"\n<p><strong>suPHP<\/strong> adds an extra layer of security to your server by ensuring that PHP scripts run under the account\u2019s own user instead of the default <strong>nobody<\/strong> user used by Apache in DSO mode. This makes it easier to track vulnerabilities and isolate security issues caused by insecure PHP scripts.<\/p>\n\n\n\n<p>Switching from <strong>DSO to suPHP<\/strong> improves accountability, enhances security, and prevents unauthorized access across user accounts in shared hosting environments.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why Use suPHP?<\/strong><\/h2>\n\n\n\n<p>Using <strong>suPHP<\/strong> offers several advantages:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Runs PHP scripts under the actual user account<\/li>\n\n\n\n<li>Improves server security and isolation<\/li>\n\n\n\n<li>Helps identify vulnerable or compromised scripts easily<\/li>\n\n\n\n<li>Prevents cross-account access issues<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Steps to Convert PHP Handler from DSO to suPHP<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Switch to suPHP Handler<\/strong><\/h3>\n\n\n\n<p>Login to your server as root and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/scripts\/easyapache<\/code><\/pre>\n\n\n\n<p>Alternatively, you can switch via WHM:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Navigate to <strong>WHM \u2192 EasyApache (Apache Update)<\/strong><\/li>\n\n\n\n<li>Rebuild Apache with <strong>suPHP enabled<\/strong><\/li>\n<\/ul>\n\n\n\n<p>Once completed:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Go to <strong>WHM \u2192 Apache Configuration \u2192 PHP and SuExec Configuration<\/strong><\/li>\n\n\n\n<li>Select <strong>suPHP<\/strong> as the PHP handler<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Update Folder Permissions<\/strong><\/h3>\n\n\n\n<p>Set all directory permissions to <strong>755<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/home\/*\/public_html -type d -exec chmod 755 {} \\;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3. Update File Permissions<\/strong><\/h3>\n\n\n\n<p>Set all file permissions to <strong>644<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/home\/*\/public_html -type f -exec chmod 644 {} \\;<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>4. Correct Ownership of Files<\/strong><\/h3>\n\n\n\n<p>Ensure proper ownership of files and folders:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for i in `ls \/var\/cpanel\/users\/`; do chown -R $i:$i \/home\/$i\/public_html ; done<br>for i in `ls \/var\/cpanel\/users\/`; do chown $i:nobody \/home\/$i\/public_html ; done<br>for i in `ls \/var\/cpanel\/users\/`; do chown $i:nobody \/home\/$i\/public_html\/_vti_pvt ; done<\/code><\/pre>\n\n\n\n<p><strong>Explanation:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First command assigns all files\/folders to the correct user<\/li>\n\n\n\n<li>Second keeps the top-level <code>public_html<\/code> owned by <code>user:nobody<\/code><\/li>\n\n\n\n<li>Third applies required permissions for FrontPage extensions<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>5. Remove Unsupported .htaccess Entries<\/strong><\/h3>\n\n\n\n<p>suPHP does not support <code>php_value<\/code> and <code>php_flag<\/code> directives in <code>.htaccess<\/code>. Remove them using:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/home -type f -name '.htaccess' -exec grep -Hrn 'php_value' '{}' \\;<br>find \/home -type f -name '.htaccess' -exec grep -Hrn 'php_flag' '{}' \\;<\/code><\/pre>\n\n\n\n<p>After locating them, manually remove those entries to avoid <strong>500 Internal Server Errors<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>6. Configure Custom php.ini<\/strong><\/h3>\n\n\n\n<p>With suPHP, PHP settings should be defined in a local <code>php.ini<\/code> file instead of <code>.htaccess<\/code>.<\/p>\n\n\n\n<p>Add the following directive:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>suPHP_ConfigPath \/home\/username\/public_html\/<\/code><\/pre>\n\n\n\n<p>Then place your custom <code>php.ini<\/code> file in that directory.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Important Notes<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Avoid using <strong>777 permissions<\/strong>, as suPHP will block such files for security reasons<\/li>\n\n\n\n<li>Always use <strong>755 for folders<\/strong> and <strong>644 for files<\/strong><\/li>\n\n\n\n<li>Test websites after migration to ensure everything works correctly<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Switching from <strong>DSO to suPHP<\/strong> significantly enhances server security by running PHP scripts under individual user accounts. By updating permissions, fixing ownership, and removing unsupported directives, you can ensure a smooth transition without errors.<\/p>\n\n\n\n<p>Proper configuration of suPHP not only protects your server from vulnerabilities but also improves monitoring and control over user activities. If you face any issues during the process, consider consulting your server administrator or support team for assistance.<\/p>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n\n\n\n<p class=\"has-text-align-center\"><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/9d590242-d641-4383-94b4-8cfd62f0af6b\"><\/a><\/span><\/span><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Partner with <strong>SupportPRO<\/strong> for 24\/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.<\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>suPHP adds an extra layer of security to your server by ensuring that PHP scripts run under the account\u2019s own user instead of the default nobody user used by Apache&hellip;<\/p>\n","protected":false},"author":4,"featured_media":16542,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-872","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-miscellaneous"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=872"}],"version-history":[{"count":8,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/872\/revisions"}],"predecessor-version":[{"id":16541,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/872\/revisions\/16541"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media\/16542"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}