From 4a90f7a287aa5fa98130964abe2e54dc09319486 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 1 Dec 2020 12:33:02 +0500 Subject: [PATCH 1/8] bug fix: cloudlinux --- CLManager/CageFS.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CLManager/CageFS.py b/CLManager/CageFS.py index 9127e4bc5..e42de14a8 100644 --- a/CLManager/CageFS.py +++ b/CLManager/CageFS.py @@ -93,10 +93,10 @@ class CageFS: logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Reinstalling important components ..\n", 1) - command = 'yum install -y lvemanager' + command = 'yum install -y lvemanager alt-python37-devel' ServerStatusUtil.executioner(command, statusFile) - command = 'yum reinstall -y lvemanager lve-utils cagefs alt-python27-cllib' + command = 'yum reinstall -y lvemanager lve-utils cagefs' ServerStatusUtil.executioner(command, statusFile) logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, From 693c38e6c5481b90c5734ce4155e31239e654197 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Tue, 1 Dec 2020 15:52:27 +0500 Subject: [PATCH 2/8] bug fix: cloudlinux --- CLManager/CageFS.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLManager/CageFS.py b/CLManager/CageFS.py index e42de14a8..17713a6b8 100644 --- a/CLManager/CageFS.py +++ b/CLManager/CageFS.py @@ -93,7 +93,7 @@ class CageFS: logging.CyberCPLogFileWriter.statusWriter(ServerStatusUtil.lswsInstallStatusPath, "Reinstalling important components ..\n", 1) - command = 'yum install -y lvemanager alt-python37-devel' + command = 'yum install -y alt-python37-devel' ServerStatusUtil.executioner(command, statusFile) command = 'yum reinstall -y lvemanager lve-utils cagefs' From 4fb826861ef7ec5de03bb35a9bad2bf2f1183ae6 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Wed, 2 Dec 2020 19:21:57 +0500 Subject: [PATCH 3/8] feature: add php8 --- install/installCyberPanel.py | 14 +++++++++++++- managePHP/phpManager.py | 10 ++++++---- plogical/upgrade.py | 11 +++++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 8e43a5aec..c16a1af1c 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -192,6 +192,15 @@ class InstallCyberPanel: if res != 0: InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 1) + command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \ + 'lsphp8? lsphp8?-common lsphp8?-curl lsphp8?-dev lsphp8?-imap lsphp8?-intl lsphp8?-json ' \ + 'lsphp8?-ldap lsphp8?-mysql lsphp8?-opcache lsphp8?-pspell lsphp8?-recode ' \ + 'lsphp8?-sqlite8 lsphp8?-tidy' + + res = os.system(command) + if res != 0: + InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 1) + elif self.distro == centos: command = 'yum -y groupinstall lsphp-all' install.preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) @@ -232,8 +241,11 @@ class InstallCyberPanel: install.preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + command = 'yum install lsphp80*' + subprocess.call(command, shell=True) + if self.distro == cent8: - command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* --exclude lsphp73-pecl-zip -y' + command = 'dnf install lsphp71* lsphp72* lsphp73* lsphp74* lsphp80* --exclude lsphp73-pecl-zip -y' subprocess.call(command, shell=True) def installMySQL(self, mysql): diff --git a/managePHP/phpManager.py b/managePHP/phpManager.py index 4a9fed7e2..c4f1ecae3 100755 --- a/managePHP/phpManager.py +++ b/managePHP/phpManager.py @@ -13,13 +13,13 @@ class PHPManager: def findPHPVersions(): distro = ProcessUtilities.decideDistro() if distro == ProcessUtilities.centos: - return ['PHP 5.3', 'PHP 5.4', 'PHP 5.5', 'PHP 5.6', 'PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4'] + return ['PHP 5.3', 'PHP 5.4', 'PHP 5.5', 'PHP 5.6', 'PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0'] elif distro == ProcessUtilities.cent8: - return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4'] + return ['PHP 7.1','PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0'] elif distro == ProcessUtilities.ubuntu20: - return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4'] + return ['PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0'] else: - return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4'] + return ['PHP 7.0', 'PHP 7.1', 'PHP 7.2', 'PHP 7.3', 'PHP 7.4', 'PHP 8.0'] @staticmethod def getPHPString(phpVersion): @@ -42,6 +42,8 @@ class PHPManager: php = "73" elif phpVersion == "PHP 7.4": php = "74" + elif phpVersion == "PHP 8.0": + php = "80" return php diff --git a/plogical/upgrade.py b/plogical/upgrade.py index c329f5438..58a2f2d17 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1939,6 +1939,10 @@ echo $oConfig->Save() ? 'Done' : 'Error'; Upgrade.executioner(command, 'Install PHP 74, 0') + if Upgrade.installedOutput.find('lsphp80') == -1: + command = 'yum install lsphp80*' + subprocess.call(command, shell=True) + except: command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \ 'lsphp7? lsphp7?-common lsphp7?-curl lsphp7?-dev lsphp7?-imap lsphp7?-intl lsphp7?-json ' \ @@ -1946,6 +1950,13 @@ echo $oConfig->Save() ? 'Done' : 'Error'; 'lsphp7?-sqlite3 lsphp7?-tidy' Upgrade.executioner(command, 'Install PHP 73, 0') + command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \ + 'lsphp8? lsphp8?-common lsphp8?-curl lsphp8?-dev lsphp8?-imap lsphp8?-intl lsphp8?-json ' \ + 'lsphp8?-ldap lsphp8?-mysql lsphp8?-opcache lsphp8?-pspell lsphp8?-recode ' \ + 'lsphp8?-sqlite8 lsphp8?-tidy' + + Upgrade.executioner(command, 'Install PHP 80, 0') + CentOSPath = '/etc/redhat-release' if not os.path.exists(CentOSPath): From 8a5f28f70a29636a40e9b4dacd50965a771fd865 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 3 Dec 2020 10:58:19 +0500 Subject: [PATCH 4/8] temp: bypass php8.0 fail on ubuntu --- install/installCyberPanel.py | 2 +- plogical/upgrade.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index c16a1af1c..7bf6d1bf8 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -199,7 +199,7 @@ class InstallCyberPanel: res = os.system(command) if res != 0: - InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 1) + InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 0) elif self.distro == centos: command = 'yum -y groupinstall lsphp-all' diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 58a2f2d17..ff30343f3 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1923,7 +1923,6 @@ echo $oConfig->Save() ? 'Done' : 'Error'; @staticmethod def installPHP73(): try: - if Upgrade.installedOutput.find('lsphp73') == -1: command = 'yum install -y lsphp73 lsphp73-json lsphp73-xmlrpc lsphp73-xml lsphp73-tidy lsphp73-soap lsphp73-snmp ' \ 'lsphp73-recode lsphp73-pspell lsphp73-process lsphp73-pgsql lsphp73-pear lsphp73-pdo lsphp73-opcache ' \ From 78842d28a76312080956b91eb12def5515abefa0 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 3 Dec 2020 10:58:34 +0500 Subject: [PATCH 5/8] temp: bypass php8.0 fail on ubuntu --- install/installCyberPanel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 7bf6d1bf8..8a67dec79 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -199,7 +199,7 @@ class InstallCyberPanel: res = os.system(command) if res != 0: - InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 0) + InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 0, 1) elif self.distro == centos: command = 'yum -y groupinstall lsphp-all' From 5e983996d301603b635878da8736d56acfadef04 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 3 Dec 2020 11:04:06 +0500 Subject: [PATCH 6/8] temp: bypass php8.0 fail on ubuntu --- install/installCyberPanel.py | 2 +- plogical/upgrade.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index 8a67dec79..e689ea660 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -241,7 +241,7 @@ class InstallCyberPanel: install.preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - command = 'yum install lsphp80*' + command = 'yum install lsphp80* -y' subprocess.call(command, shell=True) if self.distro == cent8: diff --git a/plogical/upgrade.py b/plogical/upgrade.py index ff30343f3..6fb7526e6 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1939,7 +1939,7 @@ echo $oConfig->Save() ? 'Done' : 'Error'; Upgrade.executioner(command, 'Install PHP 74, 0') if Upgrade.installedOutput.find('lsphp80') == -1: - command = 'yum install lsphp80*' + command = 'yum install lsphp80* -y' subprocess.call(command, shell=True) except: From be9126505cb3e5a17a517d5f7084b2fd2d8313dc Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 3 Dec 2020 11:40:45 +0500 Subject: [PATCH 7/8] temp: bypass php8.0 fail on ubuntu --- install/installCyberPanel.py | 13 +++---------- plogical/upgrade.py | 8 ++------ 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/install/installCyberPanel.py b/install/installCyberPanel.py index e689ea660..e4fae3f19 100755 --- a/install/installCyberPanel.py +++ b/install/installCyberPanel.py @@ -188,18 +188,11 @@ class InstallCyberPanel: 'lsphp7?-ldap lsphp7?-mysql lsphp7?-opcache lsphp7?-pspell lsphp7?-recode ' \ 'lsphp7?-sqlite3 lsphp7?-tidy' - res = os.system(command) - if res != 0: - InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 1, 1) + os.system(command) - command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \ - 'lsphp8? lsphp8?-common lsphp8?-curl lsphp8?-dev lsphp8?-imap lsphp8?-intl lsphp8?-json ' \ - 'lsphp8?-ldap lsphp8?-mysql lsphp8?-opcache lsphp8?-pspell lsphp8?-recode ' \ - 'lsphp8?-sqlite8 lsphp8?-tidy' + command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80*' + os.system(command) - res = os.system(command) - if res != 0: - InstallCyberPanel.stdOut("Failed to install PHP on Ubuntu.", 0, 1) elif self.distro == centos: command = 'yum -y groupinstall lsphp-all' diff --git a/plogical/upgrade.py b/plogical/upgrade.py index 6fb7526e6..9ff26da23 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1949,12 +1949,8 @@ echo $oConfig->Save() ? 'Done' : 'Error'; 'lsphp7?-sqlite3 lsphp7?-tidy' Upgrade.executioner(command, 'Install PHP 73, 0') - command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install ' \ - 'lsphp8? lsphp8?-common lsphp8?-curl lsphp8?-dev lsphp8?-imap lsphp8?-intl lsphp8?-json ' \ - 'lsphp8?-ldap lsphp8?-mysql lsphp8?-opcache lsphp8?-pspell lsphp8?-recode ' \ - 'lsphp8?-sqlite8 lsphp8?-tidy' - - Upgrade.executioner(command, 'Install PHP 80, 0') + command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install lsphp80*' + os.system(command) CentOSPath = '/etc/redhat-release' From 1211bd9026ed65372851506b292b76af96aad8a4 Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 3 Dec 2020 12:00:44 +0500 Subject: [PATCH 8/8] fix: https://github.com/usmannasir/cyberpanel/issues/493?fbclid=IwAR3VA5ddQonJbp85j9B4_CLQFb8WswYkpPf4Ek-a3oDOn5F-Aw8J25NZ3qs' --- managePHP/php80.xml | 275 ++++++++++++++++++++++++++++++++++++++ managePHP/ubuntuphp80.xml | 125 +++++++++++++++++ managePHP/views.py | 28 ++++ 3 files changed, 428 insertions(+) create mode 100755 managePHP/php80.xml create mode 100755 managePHP/ubuntuphp80.xml diff --git a/managePHP/php80.xml b/managePHP/php80.xml new file mode 100755 index 000000000..c95d94cee --- /dev/null +++ b/managePHP/php80.xml @@ -0,0 +1,275 @@ + + + php80 + + + lsphp80-debuginfo + Debug information for package lsphp80 + 0 + + + + lsphp80-pecl-igbinary-debuginfo + Debug information for package lsphp80-pecl-igbinary + 0 + + + + lsphp80-pecl-mcrypt-debuginfo + lsphp80 lsphp80-pecl-mcrypt-debuginfo Extension + 0 + + + + lsphp80-bcmath + A extension for PHP applications for using the bcmath library. + 1 + + + + lsphp80-common + Common files for PHP. + 1 + + + + lsphp80-dba + A database abstraction layer extension for PHP applications. + 1 + + + + lsphp80-devel + Files needed for building PHP extensions. + 0 + + + + lsphp80-enchant + Enchant spelling extension for PHP applications. + 1 + + + + lsphp80-gd + A extension for PHP applications for using the gd graphics library. + 1 + + + + lsphp80-gmp + A extension for PHP applications for using the GNU MP library. + 1 + + + + lsphp80-imap + A extension for PHP applications that use IMAP. + 1 + + + + lsphp80-intl + Internationalization extension for PHP applications. + 1 + + + + lsphp80-json + lsphp80 Json PHP Extension + 1 + + + + lsphp80-ldap + A extension for PHP applications that use LDAP. + 1 + + + + lsphp80-mbstring + A extension for PHP applications which need multi-byte string handling. + 1 + + + + lsphp80-mysqlnd + A extension for PHP applications that use MySQL databases. + 1 + + + + lsphp80-odbc + A extension for PHP applications that use ODBC databases. + 1 + + + + lsphp80-opcache + The Zend OPcache. + 1 + + + + lsphp80-pdo + A database access abstraction extension for PHP applications. + 1 + + + + lsphp80-pear + PHP Extension and Application Repository framework. + 1 + + + + lsphp80-pecl-apcu + APC User Cache. + 0 + + + + lsphp80-pecl-apcu-devel + APCu developer files (header). + 0 + + + + lsphp80-pecl-apcu-panel + APCu control panel. + 0 + + + + lsphp80-pecl-igbinary + Replacement for the standard PHP serializer. + 0 + + + + lsphp80-pecl-igbinary-devel + Igbinary developer files (header). + 0 + + + + lsphp80-pecl-mcrypt + lsphp80 lsphp80-pecl-mcrypt Extension. + 0 + + + + lsphp80-pecl-memcache + Extension to work with the Memcached caching daemon. + 0 + + + + lsphp80-pecl-memcached + Extension to work with the Memcached caching daemon. + 0 + + + + lsphp80-pecl-msgpack + API for communicating with MessagePack serialization. + 0 + + + + lsphp80-pecl-msgpack-devel + MessagePack developer files (header). + 0 + + + + lsphp80-pecl-redis + Extension for communicating with the Redis key-value store. + 0 + + + + lsphp80-pgsql + A PostgreSQL database extension for PHP. + 1 + + + + lsphp80-process + extensions for PHP script using system process interfaces. + 1 + + + + lsphp80-pspell + A extension for PHP applications for using pspell interfaces. + 1 + + + + lsphp80-recode + A extension for PHP applications for using the recode library. + 1 + + + + lsphp80-snmp + A extension for PHP applications that query SNMP-managed devices. + 1 + + + + lsphp80-soap + A extension for PHP applications that use the SOAP protocol. + 1 + + + + lsphp80-tidy + Standard PHP extension provides tidy library support. + 1 + + + + lsphp80-xml + A module for PHP applications which use XML. + 1 + + + + lsphp80-xmlrpc + A extension for PHP applications which use the XML-RPC protocol. + 1 + + + + lsphp80-zip + ZIP archive management extension for PHP + 0 + + + + lsphp80-mcrypt + Standard PHP extension provides mcrypt library support. + 1 + + + + lsphp80-dbg + php73-dbg lsphp80-package + 0 + + + + lsphp80-ioncube + ioncube loaders + 0 + + + + lsphp80-pecl-imagick + Extension to create and modify images using ImageMagick + 0 + + + diff --git a/managePHP/ubuntuphp80.xml b/managePHP/ubuntuphp80.xml new file mode 100755 index 000000000..61ef9d667 --- /dev/null +++ b/managePHP/ubuntuphp80.xml @@ -0,0 +1,125 @@ + + + php80 + + + lsphp80-common + Most of what you need. + 1 + + + + lsphp80-curl + Curl (common web tools) required for PHP + 1 + + + + lsphp80-dbg + Debugging extension + 0 + + + + lsphp80-dev + Development features almost always required. + 1 + + + + lsphp80-imap + Email extensions for PHP. + 1 + + + + lsphp80-intl + Extensions for countries other than the U.S. + 1 + + + + lsphp80-json + PHP extensions for JavaScript Object Notation. + 1 + + + + lsphp80-ldap + PHP extensions for LDAP (directory access protocol) + 1 + + + + lsphp80-modules-source + PHP source modules for virtually everything. Very large. + 0 + + + + lsphp80-mysql + PHP extension for MySQL or MariaDB databases. + 1 + + + + lsphp80-opcache + PHP low-level caching of code. Very important for performance. + 1 + + + + lsphp80-pgsql + A PostgreSQL database extension for PHP. + 0 + + + + lsphp80-pspell + PHP spell checking extensions. + 0 + + + + lsphp80-recode + PHP extension to transform data between different character sets. + 1 + + + + lsphp80-snmp + PHP network management extensions. + 0 + + + + lsphp80-sqlite3 + An extension for PHP applications that use the SQLite v3 features. + 1 + + + + lsphp80-sybase + An extension for PHP applications that use Sybase databases. + 0 + + + + lsphp80-tidy + PHP extensions for manipulating HTML, XHTML and XML documents. + 1 + + + + lsphp80-ioncube + ioncube loaders + 0 + + + + lsphp80-imagick + Extension to create and modify images using ImageMagick + 0 + + + diff --git a/managePHP/views.py b/managePHP/views.py index 8adf0f89d..9f672a3c9 100755 --- a/managePHP/views.py +++ b/managePHP/views.py @@ -1218,6 +1218,34 @@ def installExtensions(request): status=status) phpExtension.save() + try: + newPHP80 = PHP(phpVers="php80") + newPHP80.save() + + php80Path = '' + + if ProcessUtilities.decideDistro() == ProcessUtilities.centos or ProcessUtilities.decideDistro() == ProcessUtilities.cent8: + php80Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'php80.xml') + else: + php80Path = os.path.join('/usr', 'local', 'CyberCP', 'managePHP', 'ubuntuphp80.xml') + + php80 = ElementTree.parse(php80Path) + + php80Extensions = php80.findall('extension') + + for extension in php80Extensions: + extensionName = extension.find('extensionName').text + extensionDescription = extension.find('extensionDescription').text + status = int(extension.find('status').text) + + phpExtension = installedPackages(phpVers=newPHP80, + extensionName=extensionName, + description=extensionDescription, + status=status) + + phpExtension.save() + except: + pass return render(request, 'managePHP/installExtensions.html', {'phps': PHPManager.findPHPVersions()}) except KeyError: