Commit 2661ccdf authored by Marius Burkard's avatar Marius Burkard

Merge branch '30-fatal-error-php-fpm-sock' into 'master'

Resolve "Fatal error when using --use-php=system: no alternatives for php-fpm.sock"

Closes #30

See merge request !6
parents e00d02ed 311307c0
Pipeline #7811 passed with stage
in 35 seconds
......@@ -49,7 +49,7 @@ class ISPConfigDebian10OS extends ISPConfigDebianOS {
}
protected function setDefaultPHP() {
ISPConfigLog::info('Settings default system php version.', true);
ISPConfigLog::info('Setting default system php version.', true);
$cmd = 'update-alternatives --set php /usr/bin/php7.3';
$result = $this->exec($cmd);
if($result === false) {
......@@ -57,7 +57,12 @@ class ISPConfigDebian10OS extends ISPConfigDebianOS {
}
if(ISPConfig::shallInstall('web')) {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.3 ; update-alternatives --set php-fpm.sock /run/php/php7.3-fpm.sock';
// When --use-php-system is used, there is no alternative for php-fpm.sock.
if(ISPConfig::wantsPHP() === 'system') {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.3';
} else {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.3 ; update-alternatives --set php-fpm.sock /run/php/php7.3-fpm.sock';
}
$result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
......
......@@ -174,7 +174,7 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
}
protected function setDefaultPHP() {
ISPConfigLog::info('Settings default system php version.', true);
ISPConfigLog::info('Setting default system php version.', true);
$cmd = 'update-alternatives --set php /usr/bin/php7.0';
$result = $this->exec($cmd);
if($result === false) {
......@@ -182,7 +182,12 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
}
if(ISPConfig::shallInstall('web')) {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.0 ; update-alternatives --set php-fpm.sock /run/php/php7.0-fpm.sock';
// When --use-php-system is used, there is no alternative for php-fpm.sock.
if(ISPConfig::wantsPHP() === 'system') {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.0';
} else {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.0 ; update-alternatives --set php-fpm.sock /run/php/php7.0-fpm.sock';
}
$result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
......
......@@ -99,7 +99,7 @@ maxretry = 3';
}
protected function setDefaultPHP() {
ISPConfigLog::info('Settings default system php version.', true);
ISPConfigLog::info('Setting default system php version.', true);
$cmd = 'update-alternatives --set php /usr/bin/php7.4';
$result = $this->exec($cmd);
if($result === false) {
......@@ -107,7 +107,12 @@ maxretry = 3';
}
if(ISPConfig::shallInstall('web')) {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.4 ; update-alternatives --set php-fpm.sock /run/php/php7.4-fpm.sock';
// When --use-php-system is used, there is no alternative for php-fpm.sock.
if(ISPConfig::wantsPHP() === 'system') {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.4';
} else {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.4 ; update-alternatives --set php-fpm.sock /run/php/php7.4-fpm.sock';
}
$result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
......
......@@ -82,7 +82,7 @@ maxretry = 3';
}
protected function setDefaultPHP() {
ISPConfigLog::info('Settings default system php version.', true);
ISPConfigLog::info('Setting default system php version.', true);
$cmd = 'update-alternatives --set php /usr/bin/php7.2';
$result = $this->exec($cmd);
if($result === false) {
......@@ -90,7 +90,12 @@ maxretry = 3';
}
if(ISPConfig::shallInstall('web')) {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.2 ; update-alternatives --set php-fpm.sock /run/php/php7.2-fpm.sock';
// When --use-php-system is used, there is no alternative for php-fpm.sock.
if(ISPConfig::wantsPHP() === 'system') {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.2';
} else {
$cmd = 'update-alternatives --set php-cgi /usr/bin/php-cgi7.2 ; update-alternatives --set php-fpm.sock /run/php/php7.2-fpm.sock';
}
$result = $this->exec($cmd);
if($result === false) {
throw new ISPConfigOSException('Command ' . $cmd . ' failed.');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment