This commit is contained in:
1Day 2022-01-11 12:45:36 +01:00
parent 432be2f2d1
commit d66ca934d3
2 changed files with 59 additions and 0 deletions

View file

@ -0,0 +1,40 @@
<?php
$required_extentions=array("cli_server","openssl","gd","mysql","PDO","mbstring","tokenizer","bcmath","xml","curl","zip","fpm");
function checkPhpVersion(){
if (version_compare(phpversion(), '7.0', '>=')){
return "OK";
}
return "not OK";
}
function getMySQLVersion() {
$output = shell_exec('mysql -V');
preg_match('@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version);
$versionoutput = $version[0] ?? "0";
return ($versionoutput > 5 ? "OK":"not OK");;
}
function checkExtensions(){
global $required_extentions;
$not_ok = [];
$extentions = get_loaded_extensions();
foreach($required_extentions as $ext){
if(!in_array($ext,$extentions)){
array_push($not_ok,$ext);
}
}
return $not_ok;
}
?>

19
public/install/index.php Normal file
View file

@ -0,0 +1,19 @@
<?php
include ("functions.php");
echo "php version: ".checkPhpVersion();
echo "<br/>";
echo "mysql version: ".getMySQLVersion();
echo "<br/>";
echo "Missing extentions: "; foreach(checkExtensions() as $ext){ echo $ext.", ";};
echo "<br/>";
print_r(get_loaded_extensions());
?>