Đối với Cpanel 11.42 trở lên khi bạn sử dụng EasyApache để cài đặt các module cho Apache và php bạn sẽ không thấy php 5.2 và một số module khác.
Thật ra bạn vẫn có thể build php 5.2 và những module khác không hiển thị khi sử dụng EasyApache.
Cpanel đã cung cấp một danh sách các gói và cách cài đặt, cũng như cách loại bỏ cách cài đặt tùy chọn khi cài đặt không thành công.
http://docs.cpanel.net/twiki/bin/view/EasyApache/EasyApacheCustomModules
Hoặc
https://documentation.cpanel.net/display/EA/Custom+Modules
Cài đặt những gói còn thiếu: tốt nhất là bạn down một bản php 5.2 về, build nó với các extension mà bạn cần, rồi xem trên Server còn thiếu gói nào để cài đặt đầy đủ.
1 |
yum install libcurl-devel libmcrypt libmcrypt-devel aspell aspell-devel tidy libtidy libtidy-devel libxslt libxslt-devel |
Cách cài đặt các gói theo dạng tùy chỉnh:
1 2 3 4 5 |
cd /var/cpanel/easy/apache/custom_opt_mods/ wget http://easyapache.cpanel.net/optmods/$NAME.tar.gz tar -xzf $NAME.tar.gz hoặc tar -C /var/cpanel/easy/apache/custom_opt_mods -xzf $NAME.tar.gz |
$NAME.tar.gz được liệt kê trong danh sách Available Modules trong link bên trên.
Ví dụ với PHP 5.2:
http://docs.cpanel.net/twiki/pub/EasyApache/EasyApacheCustomModules/custom_opt_mod-PHP5217.tar.gz
Sau đó tạo một file all_php5
1 |
vim /var/cpanel/easy/apache/rawopts/all_php5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
--with-curl --with-gd --enable-exif --with-gettext --with-imap=/opt/php_with_imap_client/ --enable-mbstring --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-openssl=/usr --enable-pdo=shared --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-sqlite=shared --with-mime-magic --enable-soap --with-pspell --enable-wddx --with-xmlrpc --with-xsl=/opt/xslt/ --with-kerberos --with-curl --enable-zip |
Sau khi giải nén đúng như thao tác trên, bạn có thể vào EasyApache và build lại bình thường, Đến phần chọn Version cho PHP bạn chọn “None“, sau đó danh sách các option package sẽ được hiển thị tương ứng với PHP 5.2
Sau khi build xong EasyApache bạn cần build lại extension của PHP như sau:
1 2 |
/scripts/phpextensionmgr install IonCubeLoader /scripts/phpextensionmgr install Zendopt |
Bạn cũng có thể thực hiện với các extension khác khả dụng bằng command sau:
1 2 3 4 5 6 7 8 |
/scripts/phpextensionmgr list Available Extensions: EAccelerator IonCubeLoader Zendopt Xcache SourceGuardian PHPSuHosin |