-
-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Old PHP versions #1408
Comments
If you check here, you can see what PHP version can be installed to what OS version |
@master3395 I use Ubuntu 22.04 and I only have versions 8 available, I would like to use other older versions without having to change my operating system and without having to downgrade the version, is there any possibility? |
Yes, you can install older php versions on Ubuntu 22.04 PS: Not recommended because of security. Click to expand full code## Installing PHP 5.6 on Ubuntu 22.04 with CyberPanel⚠ Warning: PHP 5.6 is deprecated and no longer receives security updates. Running it on Ubuntu 22.04 can introduce security risks. It is recommended to use containers (Docker) or a dedicated virtual machine to isolate PHP 5.6. ✅ Step 1: Install Required DependenciesUpdate packages and install dependencies: sudo apt update && sudo apt upgrade -y
sudo apt install -y software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update ✅ Step 2: Install PHP 5.6 and Required Extensionssudo apt install -y php5.6 php5.6-cli php5.6-fpm php5.6-mysql php5.6-xml \
php5.6-mbstring php5.6-curl php5.6-zip php5.6-gd php5.6-soap php5.6-bcmath \
php5.6-intl php5.6-readline Verify installation: php5.6 -v Expected output:
✅ Step 3: Configure PHP 5.6 for CyberPanel1. Check existing PHP versions in CyberPanells /usr/local/lsws/lsphp* 2. Create a directory for PHP 5.6sudo mkdir -p /usr/local/lsws/lsphp56 3. Symlink PHP 5.6 binariessudo ln -s /usr/bin/php5.6 /usr/local/lsws/lsphp56/bin/php
sudo ln -s /usr/sbin/php5.6-fpm /usr/local/lsws/lsphp56/bin/php-fpm 4. Edit CyberPanel's LiteSpeed configurationsudo nano /usr/local/lsws/conf/httpd_config.conf Add this block:
Save and exit ( ✅ Step 4: Restart Servicessudo systemctl restart lsws
sudo systemctl restart php5.6-fpm ✅ Step 5: Add PHP 5.6 to CyberPanel
✅ Step 6: Test PHP 5.6Create a test file: sudo nano /home/example.com/public_html/info.php Add this content: <?php
phpinfo();
?> Save and exit. Now, visit:
You should see the PHP 5.6 information page. 🎯 Alternative: Use Docker for SecurityIf security is a concern, use a Docker container: docker run -d --name php56 -p 9000:9000 php:5.6-fpm Then, configure CyberPanel to use 🎯 Final Notes
🚀 Now PHP 5.6 is installed and configured on CyberPanel with Ubuntu 22.04! |
How to install old versions of php (5.4, 7.4) in the current version of cypberpanel?
The text was updated successfully, but these errors were encountered: