1Day 3 năm trước cách đây
mục cha
commit
d66ca934d3
2 tập tin đã thay đổi với 59 bổ sung0 xóa
  1. 40 0
      public/install/functions.php
  2. 19 0
      public/install/index.php

+ 40 - 0
public/install/functions.php

@@ -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 - 0
public/install/index.php

@@ -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());
+
+?>