ugh
This commit is contained in:
parent
432be2f2d1
commit
d66ca934d3
40
public/install/functions.php
Normal file
40
public/install/functions.php
Normal 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
19
public/install/index.php
Normal 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());
|
||||
|
||||
?>
|
Loading…
Reference in a new issue