{"id":2715,"date":"2025-12-02T21:32:09","date_gmt":"2025-12-02T18:32:09","guid":{"rendered":"https:\/\/www.dchost.com\/blog\/managing-multiple-php-versions-on-cpanel-and-directadmin-per-site\/"},"modified":"2025-12-02T21:32:09","modified_gmt":"2025-12-02T18:32:09","slug":"managing-multiple-php-versions-on-cpanel-and-directadmin-per-site","status":"publish","type":"post","link":"https:\/\/www.dchost.com\/blog\/en\/managing-multiple-php-versions-on-cpanel-and-directadmin-per-site\/","title":{"rendered":"Managing Multiple PHP Versions on cPanel and DirectAdmin Per Site"},"content":{"rendered":"<div class=\"dchost-blog-content-wrapper\"><p>If you manage more than one website on the same server or hosting account, you almost always run into a familiar problem: one project still needs PHP 7.4, another works best on PHP 8.1, and your newest build really wants PHP 8.2 or 8.3. Updating PHP globally feels risky, but leaving everything on an old version hurts performance, security, and long\u2011term maintainability. The good news is that both cPanel and DirectAdmin are built to run <strong>multiple PHP versions side by side<\/strong> and let you choose the right one per site or even per directory.<\/p>\n<p>In this article, we will walk through how we at dchost manage multiple PHP 7.x\/8.x versions on shared hosting, reseller plans, <a href=\"https:\/\/www.dchost.com\/vps\">VPS<\/a> and <a href=\"https:\/\/www.dchost.com\/dedicated-server\">dedicated server<\/a>s using cPanel and DirectAdmin. We will focus on <strong>practical decisions<\/strong>: which PHP version to choose for WordPress, WooCommerce, Laravel, PrestaShop or custom apps, and how to switch versions safely without taking sites offline. You will see concrete steps, real\u2011world patterns from agency and freelancer setups, and a strategy you can apply across all your domains.<\/p>\n<div id=\"toc_container\" class=\"toc_transparent no_bullets\"><p class=\"toc_title\">\u0130&ccedil;indekiler<\/p><ul class=\"toc_list\"><li><a href=\"#Why_PerSite_PHP_Versions_Matter\"><span class=\"toc_number toc_depth_1\">1<\/span> Why Per\u2011Site PHP Versions Matter<\/a><\/li><li><a href=\"#How_MultiPHP_Works_on_cPanel_and_DirectAdmin\"><span class=\"toc_number toc_depth_1\">2<\/span> How Multi\u2011PHP Works on cPanel and DirectAdmin<\/a><ul><li><a href=\"#MultiPHP_on_cPanel_EasyApache_4_MultiPHP_Manager\"><span class=\"toc_number toc_depth_2\">2.1<\/span> Multi\u2011PHP on cPanel (EasyApache 4 + MultiPHP Manager)<\/a><\/li><li><a href=\"#MultiPHP_on_DirectAdmin_CustomBuild_PHPFPM\"><span class=\"toc_number toc_depth_2\">2.2<\/span> Multi\u2011PHP on DirectAdmin (CustomBuild + PHP\u2011FPM)<\/a><\/li><\/ul><\/li><li><a href=\"#Choosing_the_Right_PHP_7x8x_Version_Per_Site\"><span class=\"toc_number toc_depth_1\">3<\/span> Choosing the Right PHP 7.x\/8.x Version Per Site<\/a><ul><li><a href=\"#General_decision_rules\"><span class=\"toc_number toc_depth_2\">3.1<\/span> General decision rules<\/a><\/li><li><a href=\"#WordPress_and_WooCommerce\"><span class=\"toc_number toc_depth_2\">3.2<\/span> WordPress and WooCommerce<\/a><\/li><li><a href=\"#Laravel_Symfony_and_modern_PHP_frameworks\"><span class=\"toc_number toc_depth_2\">3.3<\/span> Laravel, Symfony and modern PHP frameworks<\/a><\/li><li><a href=\"#PrestaShop_Magento_and_other_ecommerce_platforms\"><span class=\"toc_number toc_depth_2\">3.4<\/span> PrestaShop, Magento and other e\u2011commerce platforms<\/a><\/li><li><a href=\"#Legacy_custom_applications\"><span class=\"toc_number toc_depth_2\">3.5<\/span> Legacy custom applications<\/a><\/li><li><a href=\"#Checklist_before_changing_PHP_version_for_any_site\"><span class=\"toc_number toc_depth_2\">3.6<\/span> Checklist before changing PHP version for any site<\/a><\/li><\/ul><\/li><li><a href=\"#Managing_Multiple_PHP_Versions_in_cPanel_StepbyStep\"><span class=\"toc_number toc_depth_1\">4<\/span> Managing Multiple PHP Versions in cPanel: Step\u2011by\u2011Step<\/a><ul><li><a href=\"#1_Serverlevel_setup_for_VPSdedicated_and_resellers\"><span class=\"toc_number toc_depth_2\">4.1<\/span> 1. Server\u2011level setup (for VPS\/dedicated and resellers)<\/a><\/li><li><a href=\"#2_Perdomain_PHP_selection_in_cPanel\"><span class=\"toc_number toc_depth_2\">4.2<\/span> 2. Per\u2011domain PHP selection in cPanel<\/a><\/li><li><a href=\"#3_Adjusting_PHP_settings_per_domain_MultiPHP_INI_Editor\"><span class=\"toc_number toc_depth_2\">4.3<\/span> 3. Adjusting PHP settings per domain (MultiPHP INI Editor)<\/a><\/li><li><a href=\"#4_Advanced_perdirectory_overrides_with_htaccess\"><span class=\"toc_number toc_depth_2\">4.4<\/span> 4. Advanced: per\u2011directory overrides with .htaccess<\/a><\/li><\/ul><\/li><li><a href=\"#Managing_Multiple_PHP_Versions_in_DirectAdmin_StepbyStep\"><span class=\"toc_number toc_depth_1\">5<\/span> Managing Multiple PHP Versions in DirectAdmin: Step\u2011by\u2011Step<\/a><ul><li><a href=\"#1_Serverlevel_setup_with_CustomBuild\"><span class=\"toc_number toc_depth_2\">5.1<\/span> 1. Server\u2011level setup with CustomBuild<\/a><\/li><li><a href=\"#2_Perdomain_PHP_selection_in_DirectAdmin\"><span class=\"toc_number toc_depth_2\">5.2<\/span> 2. Per\u2011domain PHP selection in DirectAdmin<\/a><\/li><li><a href=\"#3_Perdomain_PHPFPM_and_ini_tuning\"><span class=\"toc_number toc_depth_2\">5.3<\/span> 3. Per\u2011domain PHP\u2011FPM and ini tuning<\/a><\/li><\/ul><\/li><li><a href=\"#A_Practical_Strategy_for_Agencies_Resellers_and_MultiSite_Owners\"><span class=\"toc_number toc_depth_1\">6<\/span> A Practical Strategy for Agencies, Resellers and Multi\u2011Site Owners<\/a><ul><li><a href=\"#1_Classify_your_sites_by_risk_and_flexibility\"><span class=\"toc_number toc_depth_2\">6.1<\/span> 1. Classify your sites by risk and flexibility<\/a><\/li><li><a href=\"#2_Assign_PHP_versions_per_bucket\"><span class=\"toc_number toc_depth_2\">6.2<\/span> 2. Assign PHP versions per bucket<\/a><\/li><li><a href=\"#3_Standardize_your_upgrade_workflow\"><span class=\"toc_number toc_depth_2\">6.3<\/span> 3. Standardize your upgrade workflow<\/a><\/li><\/ul><\/li><li><a href=\"#Common_Pitfalls_When_Running_Multiple_PHP_Versions_and_How_We_Handle_Them\"><span class=\"toc_number toc_depth_1\">7<\/span> Common Pitfalls When Running Multiple PHP Versions (and How We Handle Them)<\/a><ul><li><a href=\"#1_Missing_or_mismatched_PHP_extensions\"><span class=\"toc_number toc_depth_2\">7.1<\/span> 1. Missing or mismatched PHP extensions<\/a><\/li><li><a href=\"#2_phpini_differences_breaking_uploads_or_long_tasks\"><span class=\"toc_number toc_depth_2\">7.2<\/span> 2. php.ini differences breaking uploads or long tasks<\/a><\/li><li><a href=\"#3_Performance_regressions_due_to_untuned_PHPFPM\"><span class=\"toc_number toc_depth_2\">7.3<\/span> 3. Performance regressions due to untuned PHP\u2011FPM<\/a><\/li><li><a href=\"#4_Silent_deprecations_and_future_breaks\"><span class=\"toc_number toc_depth_2\">7.4<\/span> 4. Silent deprecations and future breaks<\/a><\/li><\/ul><\/li><li><a href=\"#Bringing_Your_PHP_Versions_Under_Control\"><span class=\"toc_number toc_depth_1\">8<\/span> Bringing Your PHP Versions Under Control<\/a><\/li><\/ul><\/div>\n<h2><span id=\"Why_PerSite_PHP_Versions_Matter\">Why Per\u2011Site PHP Versions Matter<\/span><\/h2>\n<p>On a modern hosting stack, running a single PHP version for every domain is rarely ideal. Different applications evolve at different speeds and have their own compatibility windows. Some examples we regularly see on our infrastructure:<\/p>\n<ul>\n<li><strong>Legacy corporate site<\/strong> running an old CMS that only supports PHP 7.4.<\/li>\n<li><strong>Busy WooCommerce store<\/strong> whose payment plugins are certified up to PHP 8.1.<\/li>\n<li><strong>New Laravel or Symfony app<\/strong> built directly against PHP 8.2 \/ 8.3.<\/li>\n<\/ul>\n<p>If you upgrade the server globally to PHP 8.2 for the sake of the new project, the older ones can break. If you freeze everything on PHP 7.4, newer apps miss out on performance, security, and language features. Per\u2011site (or per\u2011domain) PHP selection solves this tension.<\/p>\n<p>Running the right PHP version per site gives you several concrete benefits:<\/p>\n<ul>\n<li><strong>Compatibility<\/strong>: Keep older apps online while you refactor or migrate them.<\/li>\n<li><strong>Security<\/strong>: Move actively developed projects to supported PHP 8.x releases with ongoing security fixes.<\/li>\n<li><strong>Performance<\/strong>: Newer PHP 8.x versions often deliver noticeable speedups, especially when combined with OPcache and PHP\u2011FPM.<\/li>\n<li><strong>Risk management<\/strong>: You can upgrade and test one site at a time instead of performing a risky, all\u2011or\u2011nothing switch.<\/li>\n<\/ul>\n<p>We covered deeper technical aspects of upgrading in <a href=\"https:\/\/www.dchost.com\/blog\/en\/php-8-x-yukseltme-kontrol-listesi-wordpress-ve-laravelde-geriye-uyumluluk-opcache-preload-ve-fpm-havuz-ayarlari-nasil-tatli-tatli-kurulur\/\">our PHP 8.x upgrade checklist for WordPress and Laravel<\/a>. Here we will focus specifically on how cPanel and DirectAdmin help you run <strong>many PHPs on one server<\/strong> cleanly.<\/p>\n<h2><span id=\"How_MultiPHP_Works_on_cPanel_and_DirectAdmin\">How Multi\u2011PHP Works on cPanel and DirectAdmin<\/span><\/h2>\n<p>Before clicking any buttons, it helps to understand what is happening under the hood. On a typical dchost server, we install several PHP versions side by side (for example PHP 7.4, 8.0, 8.1, 8.2, 8.3) through the control panel\u2019s build system:<\/p>\n<ul>\n<li><strong>cPanel<\/strong> uses EasyApache 4 (\u201cea\u2011php74\u201d, \u201cea\u2011php82\u201d, and so on).<\/li>\n<li><strong>DirectAdmin<\/strong> uses CustomBuild (php1_release, php2_release, php3_release\u2026).<\/li>\n<\/ul>\n<p>Each PHP version provides its own binaries and modules. The web server (Apache or LiteSpeed) and PHP handlers (PHP\u2011FPM, lsphp, or CGI) decide <strong>which binary to call<\/strong> for each request. The control panel\u2019s GUI simply writes the correct configuration:<\/p>\n<ul>\n<li>In cPanel: Apache vhost config and <code>.htaccess<\/code> directives.<\/li>\n<li>In DirectAdmin: per\u2011domain vhost snippets and PHP\u2011FPM pool settings.<\/li>\n<\/ul>\n<p>From your point of view, you only choose the version in the interface; the panel ensures requests to <code>example.com<\/code> use, say, PHP 8.2 while <code>legacy.example.com<\/code> stays on PHP 7.4.<\/p>\n<h3><span id=\"MultiPHP_on_cPanel_EasyApache_4_MultiPHP_Manager\">Multi\u2011PHP on cPanel (EasyApache 4 + MultiPHP Manager)<\/span><\/h3>\n<p>On cPanel servers, the key components are:<\/p>\n<ul>\n<li><strong>EasyApache 4<\/strong>: where server admins enable or disable PHP versions and extensions.<\/li>\n<li><strong>MultiPHP Manager<\/strong>: where you assign a PHP version per domain or subdomain.<\/li>\n<li><strong>MultiPHP INI Editor<\/strong>: where you adjust per\u2011domain <code>php.ini<\/code> directives like <code>memory_limit<\/code> or <code>upload_max_filesize<\/code>.<\/li>\n<\/ul>\n<p>If PHP\u2011FPM is enabled, cPanel will also run <strong>separate PHP\u2011FPM pools<\/strong> per domain. This keeps resource usage isolated and makes it easier to fine\u2011tune performance for busy sites. For users hitting errors like &#8220;Resource Limit Reached&#8221; or high CPU usage when changing PHP versions, our guide on <a href=\"https:\/\/www.dchost.com\/blog\/en\/cpanelde-kaynak-limitleri-cpu-io-ep-ram-ve-resource-limit-reached-hatasi\/\">understanding cPanel resource limits and fixing the \u2018Resource Limit Reached\u2019 error<\/a> is a good companion read.<\/p>\n<h3><span id=\"MultiPHP_on_DirectAdmin_CustomBuild_PHPFPM\">Multi\u2011PHP on DirectAdmin (CustomBuild + PHP\u2011FPM)<\/span><\/h3>\n<p>DirectAdmin achieves the same goal with slightly different naming:<\/p>\n<ul>\n<li><strong>CustomBuild<\/strong>: server\u2011side tool where admins define up to 4 PHP versions (php1_release \u2026 php4_release) and choose their modes (<code>php-fpm<\/code>, <code>lsphp<\/code>, etc.).<\/li>\n<li><strong>Per\u2011Domain PHP version<\/strong>: in the user panel, you can choose which of these PHP slots a given domain will use.<\/li>\n<\/ul>\n<p>Most modern DirectAdmin setups we deploy use <strong>PHP\u2011FPM<\/strong> for all versions. Each domain can then have its own FPM pool, resource limits, and configuration. At a higher level, this is the same pattern we describe in <a href=\"https:\/\/www.dchost.com\/blog\/en\/ofiste-bir-sabah-php-yukseltmesi-ter-damlalari-ve-kucuk-bir-aydinlanma\/\">our article on running multiple PHP\u2011FPM pools per site<\/a>; DirectAdmin simply handles the plumbing for you.<\/p>\n<h2><span id=\"Choosing_the_Right_PHP_7x8x_Version_Per_Site\">Choosing the Right PHP 7.x\/8.x Version Per Site<\/span><\/h2>\n<p>Having many versions available is useful, but it raises an obvious question: <strong>which PHP version should you actually choose<\/strong> for each project? Here is how we typically approach it when designing or tuning hosting for our customers.<\/p>\n<h3><span id=\"General_decision_rules\">General decision rules<\/span><\/h3>\n<ul>\n<li><strong>Prefer the latest stable PHP 8.x<\/strong> that your application officially supports.<\/li>\n<li><strong>Avoid PHP 7.x<\/strong> for new projects; use it only as a temporary bridge for legacy code while you plan a migration.<\/li>\n<li><strong>Match framework and CMS compatibility<\/strong> (WordPress, Laravel, PrestaShop, Magento, custom apps).<\/li>\n<li><strong>Upgrade gradually<\/strong> (7.4 \u2192 8.0 \u2192 8.1\/8.2) if you maintain large, complex codebases.<\/li>\n<\/ul>\n<p>Below is a quick, real\u2011world matrix. Always verify against your specific theme, plugin, or framework versions, but this gives you a practical starting point.<\/p>\n<h3><span id=\"WordPress_and_WooCommerce\">WordPress and WooCommerce<\/span><\/h3>\n<ul>\n<li><strong>New or actively maintained sites<\/strong>: aim for <strong>PHP 8.1 or 8.2<\/strong>. Most current WordPress and plugin ecosystems support these versions well.<\/li>\n<li><strong>Heavily customized or older themes\/plugins<\/strong>: start with <strong>PHP 8.0<\/strong>, fix incompatibilities, then move toward 8.1\/8.2.<\/li>\n<li><strong>Only keep PHP 7.4<\/strong> if some critical plugin or theme vendor explicitly requires it and you have a clear plan to replace or refactor.<\/li>\n<\/ul>\n<p>If you run a busy store, combining a modern PHP 8.x version with proper object caching and database tuning can make a large difference. We explore this in detail in <a href=\"https:\/\/www.dchost.com\/blog\/en\/woocommerce-icin-mysql-innodb-tuning-kontrol-listesi-buffer-pool-indeksleme-ve-slow-query-analizi-nasil-akillica-yapilir\/\">our WooCommerce MySQL\/InnoDB tuning checklist<\/a> and our WooCommerce\u2011specific hosting guides.<\/p>\n<h3><span id=\"Laravel_Symfony_and_modern_PHP_frameworks\">Laravel, Symfony and modern PHP frameworks<\/span><\/h3>\n<ul>\n<li><strong>Recent Laravel (9\/10\/11) and Symfony versions<\/strong> are typically tested against <strong>PHP 8.1+ or 8.2+<\/strong>. Use the newest version supported by your framework release.<\/li>\n<li>For greenfield applications where you control all code, we usually recommend <strong>PHP 8.2 or 8.3<\/strong> combined with tuned PHP\u2011FPM pools.<\/li>\n<li>For older, large Laravel apps still on PHP 7.4, plan staged upgrades (7.4 \u2192 8.0 \u2192 8.1\/8.2), using feature flags and thorough testing.<\/li>\n<\/ul>\n<h3><span id=\"PrestaShop_Magento_and_other_ecommerce_platforms\">PrestaShop, Magento and other e\u2011commerce platforms<\/span><\/h3>\n<p>E\u2011commerce platforms often have strict version matrices for PHP because of their large, complex ecosystems:<\/p>\n<ul>\n<li><strong>PrestaShop<\/strong>: check the official docs for your exact release; many recent versions work well with <strong>PHP 8.1<\/strong>, older ones might need 7.4 or 8.0. We discuss this in the <a href=\"https:\/\/www.dchost.com\/blog\/en\/prestashop-hosting-rehberi-php-mysql-onbellek-ve-cdn-ayarlari\/\">PrestaShop hosting guide with PHP, MySQL, caching and CDN settings<\/a>.<\/li>\n<li><strong>Magento<\/strong>: typically lags slightly behind the newest PHP. Use whatever PHP 8.x version the vendor certifies for your Magento release.<\/li>\n<\/ul>\n<p>For these platforms, stability is often more important than being on the absolute latest PHP build. It is better to run the <strong>officially supported PHP version<\/strong> plus strong caching and database tuning than to jump ahead and risk subtle checkout bugs.<\/p>\n<h3><span id=\"Legacy_custom_applications\">Legacy custom applications<\/span><\/h3>\n<p>Legacy in\u2011house apps are where multiple PHP versions really pay off. We often see older custom CRM, intranet or reporting tools that:<\/p>\n<ul>\n<li>Use deprecated functions removed in PHP 8.x.<\/li>\n<li>Rely on libraries that are no longer maintained.<\/li>\n<li>Have no automated tests.<\/li>\n<\/ul>\n<p>In these cases we recommend:<\/p>\n<ol>\n<li>Keep the app online on <strong>PHP 7.4<\/strong> (or the minimum needed version), isolated to its own domain.<\/li>\n<li>Lock down access with strong authentication and network rules.<\/li>\n<li>Prepare a <strong>migration or rewrite plan<\/strong> while new projects move forward on PHP 8.x.<\/li>\n<\/ol>\n<h3><span id=\"Checklist_before_changing_PHP_version_for_any_site\">Checklist before changing PHP version for any site<\/span><\/h3>\n<p>Regardless of the platform, use this simple checklist before switching PHP versions on cPanel or DirectAdmin:<\/p>\n<ul>\n<li><strong>Backups:<\/strong> ensure you have a recent full backup and test restore path.<\/li>\n<li><strong>Staging environment:<\/strong> clone the site to a staging subdomain and test there first. Our guide on <a href=\"https:\/\/www.dchost.com\/blog\/en\/wordpress-staging-ortami-nasil-kurulur-cpanelde-alt-alan-adi-klonlama-ve-guvenli-yayina-alma\/\">creating a WordPress staging environment on cPanel<\/a> walks through this workflow.<\/li>\n<li><strong>Error visibility:<\/strong> enable logging (<code>display_errors=Off<\/code>, <code>log_errors=On<\/code>) so issues go to logs rather than visitors.<\/li>\n<li><strong>Maintenance window:<\/strong> schedule the cutover during a low\u2011traffic period if the site is critical.<\/li>\n<\/ul>\n<h2><span id=\"Managing_Multiple_PHP_Versions_in_cPanel_StepbyStep\">Managing Multiple PHP Versions in cPanel: Step\u2011by\u2011Step<\/span><\/h2>\n<p>Let\u2019s look at the concrete steps you can take on cPanel servers. The exact screens may vary slightly by theme, but the logic is the same.<\/p>\n<h3><span id=\"1_Serverlevel_setup_for_VPSdedicated_and_resellers\">1. Server\u2011level setup (for VPS\/dedicated and resellers)<\/span><\/h3>\n<p>If you manage a cPanel server via WHM (for example on a dchost VPS or dedicated server):<\/p>\n<ol>\n<li>Log in to <strong>WHM<\/strong> as root or reseller with sufficient privileges.<\/li>\n<li>Go to <strong>\u201cEasyApache 4\u201d<\/strong>.<\/li>\n<li>In the <strong>PHP Versions<\/strong> section, enable the versions you need (e.g. ea\u2011php74, ea\u2011php81, ea\u2011php82).<\/li>\n<li>Select common extensions (intl, mbstring, gd, imagick, pdo_mysql, etc.) for each version according to your applications.<\/li>\n<li>Provision the profile so WHM installs the chosen versions.<\/li>\n<\/ol>\n<p>Next, verify PHP\u2011FPM:<\/p>\n<ol>\n<li>Still in WHM, go to <strong>\u201cMultiPHP Manager\u201d<\/strong>.<\/li>\n<li>Enable <strong>PHP\u2011FPM<\/strong> for domains that receive higher traffic; leave very small or static sites on CGI only if needed.<\/li>\n<\/ol>\n<p>On managed dchost servers, we typically pre\u2011configure a reasonable set of PHP versions and FPM defaults, then tweak them per project.<\/p>\n<h3><span id=\"2_Perdomain_PHP_selection_in_cPanel\">2. Per\u2011domain PHP selection in cPanel<\/span><\/h3>\n<p>As a cPanel account user (shared hosting or reseller client), you can choose PHP versions per domain without accessing WHM:<\/p>\n<ol>\n<li>Log in to <strong>cPanel<\/strong>.<\/li>\n<li>Open <strong>\u201cMultiPHP Manager\u201d<\/strong>.<\/li>\n<li>Select one or more domains and subdomains from the list.<\/li>\n<li>Use the dropdown on the right to choose the desired PHP version (e.g. PHP 8.1, PHP 8.2).<\/li>\n<li>Click <strong>\u201cApply\u201d<\/strong>.<\/li>\n<\/ol>\n<p>The change is usually effective within seconds. Apache is reconfigured behind the scenes, and new requests to that domain will be served by the selected PHP version.<\/p>\n<h3><span id=\"3_Adjusting_PHP_settings_per_domain_MultiPHP_INI_Editor\">3. Adjusting PHP settings per domain (MultiPHP INI Editor)<\/span><\/h3>\n<p>Switching versions is only half the story; you often need to tune per\u2011site PHP settings:<\/p>\n<ol>\n<li>In cPanel, open <strong>\u201cMultiPHP INI Editor\u201d<\/strong>.<\/li>\n<li>Choose your domain from the dropdown.<\/li>\n<li>Adjust key directives such as:\n<ul>\n<li><code>memory_limit<\/code> (e.g. 256M or 512M for heavier apps)<\/li>\n<li><code>upload_max_filesize<\/code> and <code>post_max_size<\/code><\/li>\n<li><code>max_execution_time<\/code> (useful for imports or backups)<\/li>\n<\/ul>\n<\/li>\n<li>Save changes.<\/li>\n<\/ol>\n<p>These settings are stored in a per\u2011domain configuration and applied only to that site, regardless of which PHP version it uses.<\/p>\n<h3><span id=\"4_Advanced_perdirectory_overrides_with_htaccess\">4. Advanced: per\u2011directory overrides with .htaccess<\/span><\/h3>\n<p>Sometimes you want a different PHP version for a specific subdirectory (for example <code>\/old\u2011app<\/code> inside the same domain). On EasyApache 4 systems this is less common, but still possible. In many cases MultiPHP Manager is enough; if you go lower level:<\/p>\n<ul>\n<li>Check with support or documentation for the correct <code>AddHandler<\/code> or <code>SetHandler<\/code> directives for your environment (ea\u2011php82, lsapi, etc.).<\/li>\n<li>Add these directives to a <code>.htaccess<\/code> file in the target directory.<\/li>\n<li>Test carefully, because misconfigured handlers can cause 500 errors.<\/li>\n<\/ul>\n<p>For most users, we recommend keeping things at the <strong>domain level<\/strong> via MultiPHP Manager; it is safer and easier to maintain, especially when your team changes over time.<\/p>\n<h2><span id=\"Managing_Multiple_PHP_Versions_in_DirectAdmin_StepbyStep\">Managing Multiple PHP Versions in DirectAdmin: Step\u2011by\u2011Step<\/span><\/h2>\n<p>Now let\u2019s look at the DirectAdmin side. The underlying idea is the same, but the interface and terminology differ slightly.<\/p>\n<h3><span id=\"1_Serverlevel_setup_with_CustomBuild\">1. Server\u2011level setup with CustomBuild<\/span><\/h3>\n<p>If you administer a DirectAdmin VPS or dedicated server at dchost, you configure PHP versions through <strong>CustomBuild<\/strong>:<\/p>\n<ol>\n<li>SSH into the server as root.<\/li>\n<li>Run <code>.\/build options<\/code> in the CustomBuild directory (usually <code>\/usr\/local\/directadmin\/custombuild<\/code>).<\/li>\n<li>Set <code>php1_release<\/code>, <code>php2_release<\/code>, <code>php3_release<\/code>, etc. to the versions you need (for example 7.4, 8.0, 8.1, 8.2).<\/li>\n<li>Set <code>php1_mode<\/code>, <code>php2_mode<\/code> to <code>php-fpm<\/code> (recommended for performance and isolation).<\/li>\n<li>Save and run <code>.\/build php n<\/code> (or <code>.\/build all d<\/code> in some environments) to compile\/install the chosen releases.<\/li>\n<\/ol>\n<p>Once this is done, end users can pick among these versions per domain without touching the server internals.<\/p>\n<h3><span id=\"2_Perdomain_PHP_selection_in_DirectAdmin\">2. Per\u2011domain PHP selection in DirectAdmin<\/span><\/h3>\n<p>As a DirectAdmin user:<\/p>\n<ol>\n<li>Log in to the DirectAdmin user panel.<\/li>\n<li>Go to <strong>\u201cDomain Setup\u201d<\/strong> (or \u201cAccount Manager &gt; Domain Setup\u201d depending on skin).<\/li>\n<li>Select the domain you want to adjust.<\/li>\n<li>Look for <strong>\u201cPHP Version Selector\u201d<\/strong> or a similar option.<\/li>\n<li>Choose which PHP slot to use (PHP 8.1, PHP 8.2, etc., corresponding to php1_release, php2_release on the server).<\/li>\n<li>Save.<\/li>\n<\/ol>\n<p>New requests for that domain will now be handled by the selected PHP version using its dedicated PHP\u2011FPM pool.<\/p>\n<h3><span id=\"3_Perdomain_PHPFPM_and_ini_tuning\">3. Per\u2011domain PHP\u2011FPM and ini tuning<\/span><\/h3>\n<p>DirectAdmin typically exposes PHP\u2011FPM and php.ini options either through the GUI or via configuration files. Common tasks include:<\/p>\n<ul>\n<li>Increasing <code>memory_limit<\/code> for heavy sites.<\/li>\n<li>Adjusting <code>pm.max_children<\/code> and other FPM pool settings for busier domains.<\/li>\n<li>Configuring separate error logs per site to make debugging easier after a PHP upgrade.<\/li>\n<\/ul>\n<p>If you are hosting many sites or running an agency stack on a DirectAdmin VPS, combining this with a solid architecture is important. We discussed multi\u2011site hosting patterns in our piece on <a href=\"https:\/\/www.dchost.com\/blog\/en\/ajanslar-ve-freelancerlar-icin-hosting-mimarisi-20-wordpress-sitesini-tek-altyapida-guvenle-yonetmek\/\">hosting architecture for agencies managing 20+ WordPress sites on one stack<\/a>.<\/p>\n<h2><span id=\"A_Practical_Strategy_for_Agencies_Resellers_and_MultiSite_Owners\">A Practical Strategy for Agencies, Resellers and Multi\u2011Site Owners<\/span><\/h2>\n<p>Running many sites on one server is not just a technical exercise; it also requires <strong>policy<\/strong>. Here is a pragmatic strategy we use when onboarding agency and reseller customers to dchost infrastructure.<\/p>\n<h3><span id=\"1_Classify_your_sites_by_risk_and_flexibility\">1. Classify your sites by risk and flexibility<\/span><\/h3>\n<p>Create three simple buckets:<\/p>\n<ul>\n<li><strong>Active projects<\/strong>: you can change code, update plugins, and fix issues quickly.<\/li>\n<li><strong>Stable but maintained<\/strong>: sites that receive updates, but are business\u2011critical and risk\u2011averse.<\/li>\n<li><strong>Legacy\/blocked<\/strong>: you cannot touch the code easily; upgrades are politically or technically difficult.<\/li>\n<\/ul>\n<h3><span id=\"2_Assign_PHP_versions_per_bucket\">2. Assign PHP versions per bucket<\/span><\/h3>\n<ul>\n<li><strong>Active projects<\/strong>: run on the newest stable PHP 8.x version supported by your stack (for example PHP 8.2), and plan fast adoption when new minor versions are released.<\/li>\n<li><strong>Stable but maintained<\/strong>: run on a slightly more conservative PHP 8.x (for example 8.1 or 8.2), upgrade once or twice a year after testing.<\/li>\n<li><strong>Legacy\/blocked<\/strong>: isolate on PHP 7.4 or the lowest viable version, tighten security, and document a long\u2011term exit plan.<\/li>\n<\/ul>\n<h3><span id=\"3_Standardize_your_upgrade_workflow\">3. Standardize your upgrade workflow<\/span><\/h3>\n<p>For each site, upgrades should follow a consistent pattern instead of ad\u2011hoc changes in production. A solid flow looks like this:<\/p>\n<ol>\n<li><strong>Clone to staging<\/strong> (subdomain or separate account).<\/li>\n<li><strong>Deploy code via Git<\/strong> so you can roll back quickly if needed; see our guide on <a href=\"https:\/\/www.dchost.com\/blog\/en\/git-ile-otomatik-deploy-cpanel-plesk-ve-vpste-adim-adim-kurulum\/\">Git deployment workflows on cPanel, Plesk and VPS<\/a>.<\/li>\n<li><strong>Switch PHP version on staging<\/strong> and test key flows (login, forms, checkout, admin screens).<\/li>\n<li><strong>Fix deprecations and errors<\/strong>, commit, and redeploy.<\/li>\n<li><strong>Schedule production upgrade<\/strong> and repeat the same PHP switch + deploy combo.<\/li>\n<\/ol>\n<p>For WordPress and WooCommerce, combining staging, proper backups, and per\u2011site PHP settings is the basis of safe updates. We describe that philosophy in our article on <a href=\"https:\/\/www.dchost.com\/blog\/en\/woocommerce-guncellemelerini-guvenle-yapmak\/\">safe WooCommerce updates on shared hosting and VPS<\/a>.<\/p>\n<h2><span id=\"Common_Pitfalls_When_Running_Multiple_PHP_Versions_and_How_We_Handle_Them\">Common Pitfalls When Running Multiple PHP Versions (and How We Handle Them)<\/span><\/h2>\n<p>Multi\u2011PHP setups are powerful, but there are a few recurring issues we see when teams start using them more actively.<\/p>\n<h3><span id=\"1_Missing_or_mismatched_PHP_extensions\">1. Missing or mismatched PHP extensions<\/span><\/h3>\n<p>Each PHP version has its own set of compiled extensions. You might have <code>imagick<\/code> enabled on PHP 7.4 but not on 8.2. Symptoms include white screens, 500 errors, or &#8220;Class not found&#8221; messages only after changing versions.<\/p>\n<p><strong>How we handle it:<\/strong><\/p>\n<ul>\n<li>Standardize a base set of extensions (intl, mbstring, gd, zip, pdo_mysql, xml, curl, etc.) across all PHP versions on the server.<\/li>\n<li>Document any project\u2011specific extensions and ensure they are installed for all target versions before switching.<\/li>\n<\/ul>\n<h3><span id=\"2_phpini_differences_breaking_uploads_or_long_tasks\">2. php.ini differences breaking uploads or long tasks<\/span><\/h3>\n<p>When you switch PHP versions, the effective php.ini may change. Limits like <code>upload_max_filesize<\/code>, <code>post_max_size<\/code>, and <code>max_execution_time<\/code> can suddenly become lower than what your app needs.<\/p>\n<p><strong>How we handle it:<\/strong><\/p>\n<ul>\n<li>After every PHP switch, double\u2011check and adjust these values via MultiPHP INI Editor (cPanel) or per\u2011domain settings (DirectAdmin).<\/li>\n<li>Test file uploads, imports, and backup plugins explicitly.<\/li>\n<\/ul>\n<h3><span id=\"3_Performance_regressions_due_to_untuned_PHPFPM\">3. Performance regressions due to untuned PHP\u2011FPM<\/span><\/h3>\n<p>Moving from PHP 7.4 to 8.1 or 8.2 usually improves performance, but if PHP\u2011FPM pool settings are too tight, you might see slowdowns or 502\/503 errors under load.<\/p>\n<p><strong>How we handle it:<\/strong><\/p>\n<ul>\n<li>Review <code>pm.max_children<\/code>, <code>pm.max_requests<\/code>, and related FPM directives when upgrading.<\/li>\n<li>Combine PHP tuning with caching and database optimisation, as described in our guide on <a href=\"https:\/\/www.dchost.com\/blog\/en\/wordpress-icin-sunucu-tarafi-optimizasyon-php-fpm-opcache-redis-ve-mysql-ile-neyi-ne-zaman-nasil-ayarlamalisin\/\">server\u2011side secrets that make WordPress fly (PHP\u2011FPM, OPcache, Redis and MySQL tuning)<\/a>.<\/li>\n<\/ul>\n<h3><span id=\"4_Silent_deprecations_and_future_breaks\">4. Silent deprecations and future breaks<\/span><\/h3>\n<p>PHP 8.x introduces new deprecations. Even if everything &#8220;seems fine&#8221; after switching, your logs might be full of warnings that will become fatal errors in future versions.<\/p>\n<p><strong>How we handle it:<\/strong><\/p>\n<ul>\n<li>Turn on error logging and periodically review logs, especially after a version change.<\/li>\n<li>Use staging to upgrade not just to the currently supported version, but also test the next minor (e.g. test 8.3 early while running 8.2 in production).<\/li>\n<\/ul>\n<h2><span id=\"Bringing_Your_PHP_Versions_Under_Control\">Bringing Your PHP Versions Under Control<\/span><\/h2>\n<p>Managing multiple PHP versions on cPanel and DirectAdmin is not about ticking a checkbox once and forgetting it. It is about having a <strong>clear, repeatable strategy<\/strong> for each site on your hosting stack: which PHP version it runs, how it is configured, and when it will be upgraded next. With the right approach, you can keep legacy applications online, modern projects fast and secure, and your overall platform predictable.<\/p>\n<p>On our shared hosting, reseller plans, VPS, dedicated servers and colocation setups at dchost, we design the infrastructure specifically to support this kind of per\u2011site PHP management. Whether you manage a single WooCommerce store or dozens of client sites, you can use MultiPHP Manager on cPanel or the PHP selector in DirectAdmin to align each domain with the most appropriate PHP 7.x\/8.x version, backed by good staging, backup and monitoring practices.<\/p>\n<p>If you are unsure which PHP versions to provide on a new server, or you want help planning a large\u2011scale upgrade across many sites, our team can review your current stack, suggest a version strategy, and configure your cPanel or DirectAdmin environment accordingly. The result is a calmer, more controlled hosting experience where PHP upgrades become a routine operation rather than a source of anxiety.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>If you manage more than one website on the same server or hosting account, you almost always run into a familiar problem: one project still needs PHP 7.4, another works best on PHP 8.1, and your newest build really wants PHP 8.2 or 8.3. Updating PHP globally feels risky, but leaving everything on an old [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2716,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-2715","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-teknoloji"],"_links":{"self":[{"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/posts\/2715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/comments?post=2715"}],"version-history":[{"count":0,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/posts\/2715\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/media\/2716"}],"wp:attachment":[{"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/media?parent=2715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/categories?post=2715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dchost.com\/blog\/en\/wp-json\/wp\/v2\/tags?post=2715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}