php is .ini not .conf

This commit is contained in:
Daniel Winzen
2018-10-26 19:14:29 +02:00
parent 9985ba4864
commit 1884f4b08b
2 changed files with 22 additions and 12 deletions

View File

@ -4,7 +4,7 @@ const DBUSER='hosting'; // Database user
const DBPASS='MY_PASSWORD'; // Database password const DBPASS='MY_PASSWORD'; // Database password
const DBNAME='hosting'; // Database const DBNAME='hosting'; // Database
const PERSISTENT=true; // Use persistent database conection true/false const PERSISTENT=true; // Use persistent database conection true/false
const DBVERSION=8; //database layout version const DBVERSION=9; //database layout version
const CAPTCHA=0; // Captcha difficulty (0=off, 1=simple, 2=moderate, 3=extreme) const CAPTCHA=0; // Captcha difficulty (0=off, 1=simple, 2=moderate, 3=extreme)
const ADDRESS='dhosting4okcs22v.onion'; // our own address const ADDRESS='dhosting4okcs22v.onion'; // our own address
const SERVERS=[ //servers and ports we are running on const SERVERS=[ //servers and ports we are running on

View File

@ -39,11 +39,11 @@ if(!@$version=$db->query("SELECT value FROM settings WHERE setting='version';"))
if(!file_exists("/etc/php/$version/fpm/conf.d/")){ if(!file_exists("/etc/php/$version/fpm/conf.d/")){
mkdir("/etc/php/$version/fpm/conf.d/", 0755, true); mkdir("/etc/php/$version/fpm/conf.d/", 0755, true);
} }
file_put_contents("/etc/php/$version/fpm/conf.d/99-hosting.conf", PHP_CONFIG); file_put_contents("/etc/php/$version/fpm/conf.d/99-hosting.ini", PHP_CONFIG);
if(!file_exists("/etc/php/$version/cli/conf.d/")){ if(!file_exists("/etc/php/$version/cli/conf.d/")){
mkdir("/etc/php/$version/cli/conf.d/", 0755, true); mkdir("/etc/php/$version/cli/conf.d/", 0755, true);
} }
file_put_contents("/etc/php/$version/cli/conf.d/99-hosting.conf", PHP_CONFIG); file_put_contents("/etc/php/$version/cli/conf.d/99-hosting.ini", PHP_CONFIG);
$fpm_config = "[global] $fpm_config = "[global]
pid = /run/php/php$version-fpm.pid pid = /run/php/php$version-fpm.pid
error_log = /var/log/php$version-fpm.log error_log = /var/log/php$version-fpm.log
@ -134,7 +134,6 @@ pm.max_children = 8
$replace=preg_replace("~listen\sunix:/var/run/nginx(/[a-z2-7]{16}|\.sock)(\sbacklog=2048)?;~", "listen unix:/var/run/nginx/$system_account backlog=2048;", file_get_contents("/etc/nginx/sites-enabled/$system_account")); $replace=preg_replace("~listen\sunix:/var/run/nginx(/[a-z2-7]{16}|\.sock)(\sbacklog=2048)?;~", "listen unix:/var/run/nginx/$system_account backlog=2048;", file_get_contents("/etc/nginx/sites-enabled/$system_account"));
file_put_contents("/etc/nginx/sites-enabled/$system_account", $replace); file_put_contents("/etc/nginx/sites-enabled/$system_account", $replace);
} }
exec('service nginx reload');
} }
if($version<7){ if($version<7){
$db->exec("ALTER TABLE onions ADD max_streams tinyint(3) unsigned NOT NULL DEFAULT '20';"); $db->exec("ALTER TABLE onions ADD max_streams tinyint(3) unsigned NOT NULL DEFAULT '20';");
@ -146,14 +145,6 @@ pm.max_children = 8
} }
if($version<8){ if($version<8){
foreach(PHP_VERSIONS as $version){ foreach(PHP_VERSIONS as $version){
if(!file_exists("/etc/php/$version/fpm/conf.d/")){
mkdir("/etc/php/$version/fpm/conf.d/", 0755, true);
}
file_put_contents("/etc/php/$version/fpm/conf.d/99-hosting.conf", PHP_CONFIG);
if(!file_exists("/etc/php/$version/cli/conf.d/")){
mkdir("/etc/php/$version/cli/conf.d/", 0755, true);
}
file_put_contents("/etc/php/$version/cli/conf.d/99-hosting.conf", PHP_CONFIG);
$fpm_config = "[global] $fpm_config = "[global]
pid = /run/php/php$version-fpm.pid pid = /run/php/php$version-fpm.pid
error_log = /var/log/php$version-fpm.log error_log = /var/log/php$version-fpm.log
@ -202,6 +193,25 @@ pm.max_children = 8
} }
} }
} }
if($version<9){
foreach(PHP_VERSIONS as $version){
if(file_exists("/etc/php/$version/cli/conf.d/99-hosting.conf")){
unlink("/etc/php/$version/cli/conf.d/99-hosting.conf");
}
if(file_exists("/etc/php/$version/fpm/conf.d/99-hosting.conf")){
unlink("/etc/php/$version/fpm/conf.d/99-hosting.conf");
}
if(!file_exists("/etc/php/$version/fpm/conf.d/")){
mkdir("/etc/php/$version/fpm/conf.d/", 0755, true);
}
file_put_contents("/etc/php/$version/fpm/conf.d/99-hosting.ini", PHP_CONFIG);
if(!file_exists("/etc/php/$version/cli/conf.d/")){
mkdir("/etc/php/$version/cli/conf.d/", 0755, true);
}
file_put_contents("/etc/php/$version/cli/conf.d/99-hosting.ini", PHP_CONFIG);
}
$db->exec('UPDATE service_instances SET reload=1;');
}
$stmt=$db->prepare("UPDATE settings SET value=? WHERE setting='version';"); $stmt=$db->prepare("UPDATE settings SET value=? WHERE setting='version';");
$stmt->execute([DBVERSION]); $stmt->execute([DBVERSION]);
if(DBVERSION!=$version){ if(DBVERSION!=$version){