mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-07-08 14:22:58 +02:00
added check for not-available php versions
This commit is contained in:
@@ -686,6 +686,10 @@ class vhost:
|
||||
|
||||
php = PHPManager.getPHPString(phpVersion)
|
||||
|
||||
if not os.path.exists("/usr/local/lsws/lsphp" + str(php) + "/bin/lsphp"):
|
||||
print 0, 'This PHP version is not available on your CyberPanel.'
|
||||
return [0, "[This PHP version is not available on your CyberPanel. [changePHP]"]
|
||||
|
||||
writeDataToFile = open(vhFile, "w")
|
||||
|
||||
path = " path /usr/local/lsws/lsphp" + str(php) + "/bin/lsphp\n"
|
||||
@@ -704,15 +708,19 @@ class vhost:
|
||||
return 1,'None'
|
||||
except BaseException, msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(
|
||||
str(msg) + " [IO Error with per host config file [changePHP]]")
|
||||
str(msg) + " [IO Error with per host config file [changePHP]")
|
||||
print 0,str(msg)
|
||||
return [0, str(msg) + " [IO Error with per host config file [changePHP]]"]
|
||||
return [0, str(msg) + " [IO Error with per host config file [changePHP]"]
|
||||
else:
|
||||
try:
|
||||
data = open(vhFile, "r").readlines()
|
||||
|
||||
php = PHPManager.getPHPString(phpVersion)
|
||||
|
||||
if not os.path.exists("/usr/local/lsws/lsphp" + str(php) + "/bin/lsphp"):
|
||||
print 0, 'This PHP version is not available on your CyberPanel.'
|
||||
return [0, "[This PHP version is not available on your CyberPanel. [changePHP]"]
|
||||
|
||||
writeDataToFile = open(vhFile, "w")
|
||||
|
||||
finalString = ' AddHandler application/x-httpd-php' + str(php) + ' .php\n'
|
||||
|
||||
Reference in New Issue
Block a user