🐘💻 CyberPanel Full LSPHP Installation Wiki (PHP 7.4 – 8.3)
📌 Purpose
Install multiple PHP versions for websites, with all commonly used modules, fully compatible with OpenLiteSpeed / LiteSpeed Enterprise. Streamlines PHP management on CyberPanel servers.
⚡ Pre-Upgrade Script
sh <(curl -s https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh || wget -O - https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/preUpgrade.sh)
This prepares the server by installing all dependencies needed for PHP installations, preventing broken packages or missing libraries.
Install PHP Versions and Modules
🐘 Install LSPHP 7.4
apt install -y lsphp74-apcu lsphp74-common lsphp74-curl lsphp74-dbg lsphp74-dev lsphp74-igbinary lsphp74-imagick lsphp74-imap lsphp74-intl lsphp74-ioncube lsphp74-json lsphp74-ldap lsphp74-memcached lsphp74-modules-source lsphp74-msgpack lsphp74-mysql lsphp74-opcache lsphp74-pear lsphp74-pgsql lsphp74-pspell lsphp74-redis lsphp74-snmp lsphp74-sqlite3 lsphp74-sybase lsphp74-tidy
Installs PHP 7.4 with all essential modules for databases, caching, image processing, and security.
🐬 Install LSPHP 8.0
apt install -y lsphp80 lsphp80-apcu lsphp80-common lsphp80-curl lsphp80-dbg lsphp80-dev lsphp80-igbinary lsphp80-imagick lsphp80-imap lsphp80-intl lsphp80-ldap lsphp80-memcached lsphp80-modules-source lsphp80-msgpack lsphp80-mysql lsphp80-opcache lsphp80-pear lsphp80-pgsql lsphp80-pspell lsphp80-redis lsphp80-snmp lsphp80-sqlite3
Installs PHP 8.0 and modules needed for modern web applications.
🦄 Install LSPHP 8.1
apt install -y lsphp81 lsphp81-apcu lsphp81-common lsphp81-curl lsphp81-dbg lsphp81-dev lsphp81-igbinary lsphp81-imagick lsphp81-imap lsphp81-intl lsphp81-ioncube lsphp81-ldap lsphp81-memcached lsphp81-modules-source lsphp81-msgpack lsphp81-mysql lsphp81-opcache lsphp81-pear lsphp81-pgsql lsphp81-pspell lsphp81-redis lsphp81-snmp lsphp81-sqlite3 lsphp81-sybase lsphp81-tidy
Installs PHP 8.1 with modules for caching, databases, images, and security enhancements.
🌟 Install LSPHP 8.2
apt install -y lsphp82 lsphp82-apcu lsphp82-common lsphp82-curl lsphp82-dbg lsphp82-dev lsphp82-igbinary lsphp82-imagick lsphp82-imap lsphp82-intl lsphp82-ldap lsphp82-memcached lsphp82-modules-source lsphp82-msgpack lsphp82-mysql lsphp82-opcache lsphp82-pear lsphp82-pgsql
Installs PHP 8.2 for advanced web applications with optimized performance.
🚀 Install LSPHP 8.3
apt install -y lsphp83 lsphp83-apcu lsphp83-common lsphp83-curl lsphp83-dbg lsphp83-dev lsphp83-igbinary lsphp83-imagick lsphp83-imap lsphp83-intl lsphp83-ldap lsphp83-memcached lsphp83-modules-source lsphp83-msgpack lsphp83-mysql lsphp83-opcache lsphp83-pear lsphp83-pgsql
Installs PHP 8.3 with the latest modules for modern web apps and compatibility with future updates.
⚡ One-line Installation for All Versions
apt update && apt install -y lsphp74 lsphp74-* lsphp80 lsphp80-* lsphp81 lsphp81-* lsphp82 lsphp82-* lsphp83 lsphp83-* --no-install-recommends && service lsws reload
Installs all PHP versions at once and reloads OpenLiteSpeed so it detects the new PHP binaries.
🔄 Reload OpenLiteSpeed
service lsws reload
Reloading OpenLiteSpeed ensures all installed PHP versions are active and available to websites.
✅ Verify PHP Installation
Check each PHP version to confirm installation:
lsphp74 -v lsphp80 -v lsphp81 -v lsphp82 -v lsphp83 -v
Each command outputs the installed version and confirms that the corresponding PHP binary is working correctly.
🧩 Optional Module Installation
For specific application needs, install extra modules:
apt install -y lsphp83-apcu lsphp83-intl lsphp83-imagick lsphp83-redis
This allows you to add only the modules required for particular websites without installing unnecessary packages.
🌈 Best Practices
Always check which PHP modules your applications require.
Reload OpenLiteSpeed after installing any new PHP version or module.
Keep PHP packages updated regularly:
apt update && apt upgrade -y
Remove unused PHP versions to reduce potential security risks.
Document installed PHP versions and modules for server maintenance.