İçeriğe geç
KAMPANYA Kurumsal Web Paketi — $499'dan başlayan fiyatlar Web & Logo Tasarımı · Kurumsal E-posta · LiteSpeed + CloudLinux · Imunify360 Güvenlik · cPanel Yönetim · 3 Gbps DDoS Koruması 00 Gün 00 Saat 00 Dk 00 Sn
AIOR

How to Add a New PHP Version on cPanel and CloudLinux — A Practical Guide

Sektör topluluğu — sorularınız, deneyimleriniz ve duyurularınız için.

How to Add a New PHP Version on cPanel and CloudLinux — A Practical Guide

Aior

Administrator
Staff member
Joined
Apr 2, 2023
Messages
895
Reaction score
2
Points
18
Age
40
Location
Turkey
Website
aior.com
1/3
Thread owner

cPanel sunucularında PHP sürüm yönetimini esnek hâle getiren bileşen, EasyApache 4 (EA4) ile CloudLinux'un alt yapı seçim mekanizmasıdır. Yeni bir PHP sürümünü kullanıma açmak, doğrudan kullanıcı hesabına paket atamaktan ibaret değildir. Önce sistem genelinde paketin yüklenmesi, ardından PHP Selector veya MultiPHP Manager üzerinden hesap düzeyinde etkinleştirilmesi gerekir. Bu yazıda AlmaLinux 8 + CloudLinux + cPanel kombinasyonunu temel alarak, bir hostname ve birden çok kullanıcı hesabıyla çalışan tipik bir sunucu için sürüm ekleme akışını adım adım anlatıyoruz.

1) Mevcut durumu doğrulayın
Komut satırında SSH üzerinden root oturumu açıp cagefsctl --show-ver ve /scripts/restartsrv_httpd --status ile WSGI/Apache servislerinin sağlıklı olduğunu kontrol edin. CloudLinux'ta hangi sürümlerin yüklü olduğunu görmek için cl-php-list veya selectorctl --list kullanılır. EA4 tarafında yüklü PHP paketlerini sıralamak için yum list installed ea-php\* komutu en hızlı yoldur. Bu adım kritiktir; çünkü kullanıcı zaten varsayılan olarak PHP 8.2 görüyor olabilir ama altında modül seti eksik olabilir.

2) Sürümü EA4 üzerinden yükleyin
WHM > EasyApache 4 menüsünden mevcut profili kopyalayıp eklemek istediğiniz PHP sürümünü (örneğin 8.3) seçin. Modülleri ihtiyaçlarınıza göre işaretleyin: ea-php83-php-mbstring, ea-php83-php-curl, ea-php83-php-gd, ea-php83-php-intl, ea-php83-php-zip, ea-php83-php-mysqlnd çoğu site için zorunludur. Provision adımının tamamlanmasını bekleyin. Komut satırında aynı işi yum -y install ea-php83 ea-php83-php-fpm ea-php83-php-mbstring ea-php83-php-mysqlnd ea-php83-php-curl ea-php83-php-gd ea-php83-php-intl ea-php83-php-zip komutu yapar.

3) CloudLinux PHP Selector tarafına eşitleyin
EA4 sürümü yüklenmesine rağmen kullanıcı PHP Selector'da hâlâ yeni sürümü göremiyorsa, cagefsctl --setup-cl-selector ve sonrasında cagefsctl --force-update çalıştırılmalıdır. Selector yapılandırmasını yenilemek için selectorctl --interpreter=php --refresh de güvenli bir adımdır. CageFS hesaplarda etkinse cagefsctl --remount-all ile bağlama noktalarını tazeleyin.

4) Hesap düzeyinde etkinleştirme
WHM > MultiPHP Manager içinden hesap veya alan bazında varsayılan PHP sürümünü 8.3 olarak ayarlayın. Eğer kullanıcılarınızın PHP Selector'da görmesini istiyorsanız WHM > CloudLinux LVE Manager > Selector menüsünden 8.3'ü etkin işaretlemelisiniz. Tek bir hesap için komut satırından şu yöntem geçerlidir: selectorctl --user=cpaneluser --set-user-current-version=8.3.

5) PHP-FPM havuzlarını yeniden başlatın
EA4 PHP-FPM kullanıyorsa /scripts/restartsrv_apache_php_fpm komutuyla yeni havuzlar oluşturulur. Ardından php -v ile sürümün doğrulamasını yapın; hesap kullanıcısı için ise su - cpaneluser -c "php -v" doğrulayıcıdır.

6) Yaygın hatalar ve hızlı çözümler
  • Selector'da sürüm görünmüyor: cagefsctl --force-update + Apache restart.
  • Modül eksik: ea-php83-php-* paketlerini tek tek yükleyin; opcache çoğu zaman ayrı bir paket olarak gelir.
  • Hesap yine eski sürümü çalıştırıyor: .htaccess içinde sabit AddHandler veya SetHandler tanımı olabilir; bunu kaldırın.
  • FPM hata veriyor: /var/log/php-fpm/ altındaki log dosyasını ve hesabın imunify360 olaylarını kontrol edin.

7) Yedek kontrolü ve dönüş
Yeni sürümle uyumsuz çıkan WHMCS, WordPress veya XenForo gibi uygulamalarda hızlı dönüş için MultiPHP Manager üzerinden bir önceki sürüme geri alın; CloudLinux Selector tarafında da sürümü hesap bazında geri çevirin. EA4 paketleri sistem üzerinde kalmaya devam eder, böylece tekrar etkinleştirmek saniyeler içinde mümkündür. Bu yöntem üretim trafiğini riske atmadan PHP sürümünü esnek bir şekilde yönetebilmenizi sağlar.


Managing PHP versions on a cPanel server is the combined responsibility of EasyApache 4 (EA4) and the CloudLinux selector layer. Adding a new PHP version is not a single button press on a user account; instead, the package has to be installed on the system first, then surfaced through the PHP Selector or MultiPHP Manager so individual accounts can switch. This guide walks through the workflow on an AlmaLinux 8 box running cPanel and CloudLinux, the most common stack for a server hosting multiple users behind one hostname.

1) Verify the current state
Open an SSH root session and run cagefsctl --show-ver together with /scripts/restartsrv_httpd --status to make sure Apache and CageFS are healthy before touching anything. To see which versions are already available, run cl-php-list or selectorctl --list for the CloudLinux side, and yum list installed ea-php\* for the EA4 side. This step matters because users often see PHP 8.2 as the default while the underlying module set is incomplete.

2) Install the new version through EA4
Inside WHM go to EasyApache 4, clone the existing profile and tick the PHP version you want to add — say 8.3. Pick the modules your sites need: ea-php83-php-mbstring, ea-php83-php-curl, ea-php83-php-gd, ea-php83-php-intl, ea-php83-php-zip and ea-php83-php-mysqlnd cover most production workloads. Wait for provisioning to finish. The same operation from the shell is yum -y install ea-php83 ea-php83-php-fpm ea-php83-php-mbstring ea-php83-php-mysqlnd ea-php83-php-curl ea-php83-php-gd ea-php83-php-intl ea-php83-php-zip.

3) Sync with the CloudLinux PHP Selector
After EA4 finishes, the user-facing Selector may still not show 8.3. Run cagefsctl --setup-cl-selector followed by cagefsctl --force-update to register the new interpreter. Refresh the selector cache with selectorctl --interpreter=php --refresh and, if CageFS is enabled on accounts, remount mounts with cagefsctl --remount-all so the change becomes visible inside each user's jail.

4) Enable on accounts
Set the default PHP version per account or domain through WHM > MultiPHP Manager. If you want users to pick versions themselves, allow 8.3 under WHM > CloudLinux LVE Manager > Selector. From the CLI a single account can be switched with selectorctl --user=cpaneluser --set-user-current-version=8.3.

5) Restart PHP-FPM pools
If EA4 is running PHP-FPM, run /scripts/restartsrv_apache_php_fpm so new pools spawn with the right binary. Verify with php -v at the system level and su - cpaneluser -c "php -v" in the user's context.

6) Common pitfalls and fast fixes
  • Version is missing from the Selector — run cagefsctl --force-update and restart Apache.
  • A module is missing — install the corresponding ea-php83-php-* package; OPcache often ships as a separate RPM.
  • The account keeps running the old version — check .htaccess for a hardcoded AddHandler or SetHandler and remove it.
  • FPM fails to start — read the log under /var/log/php-fpm/ and review Imunify360 events for the account.

7) Rollback path
If a legacy application such as WHMCS, WordPress or XenForo trips on the new version, roll back in MultiPHP Manager and the Selector. EA4 packages remain installed on disk, so flipping back to 8.3 later is instant. This pattern lets you ship new PHP versions without putting production traffic at risk and without making CloudLinux fight with EasyApache.
 
Last edited:

Forum statistics

Threads
891
Messages
898
Members
27
Latest member
AIORAli

Members online

No members online now.

Featured content

AIOR
AIOR TEKNOLOJİ

Tüm ihtiyaçlarınız için Teklif alın

Hosting · Domain · Sunucu · Tasarım · Yazılım · Mühendislik · Sektörel Çözümler

Teklif al

7/24 Destek · Anında yanıt

Back
Top