Я пытаюсь установить свой сценарий CMS на моем сервере, все работает отлично на Xampp, однако, когда я устанавливаю его на свой сервер (VPS), он устанавливается отлично, и я могу получить доступ к сценарию (страницам веб-сайта), но не к администратору панель (после ввода пароля отображается пустая страница)
Apache В журнале ошибок указано:
[Wed May 06 20:14:22.677240 2020] [fcgid:warn] [pid 18988] [client 12x.x8.xxx.xxx:49816] mod_fcgid: stderr: PHP Fatal error: Call to undefined function bcpow() in /home/example/public_html/application/system/function_security.php on line 75, referer: https://www.example.com/admin/
Это моя function_security. php
<?php
require_once ("launcher.php");
//--
function PHP_DatesCrypt($action, $string) {
global $options_launcher;
$output = false;
$encrypt_method = "AES-256-CBC";
$secret_key = $options_launcher['crypt_secret_key'];
$secret_iv = $options_launcher['crypt_password'];
// hash
$key = hash('sha256', $secret_key);
// iv - encrypt method AES-256-CBC expects 16 bytes - else you will get a warning
$iv = substr(hash('sha256', $secret_iv), 0, 16);
if ( $action == 'encrypt' ) {
$output = openssl_encrypt($string, $encrypt_method, $key, 0, $iv);
$output = base64_encode($output);
} else if( $action == 'decrypt' ) {
$output = openssl_decrypt(base64_decode($string), $encrypt_method, $key, 0, $iv);
}
return $output;
}
//--
function PHP_Crypt_code($in, $to_num = false, $pad_up = false, $pass_key = null) {
$out = '';
$index = 'abcdefghijklmnopqrstuvwxyz';
$index.= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
$index.= '0123456789';
$base = strlen($index);
if ($pass_key !== null) {
for ($n = 0; $n < strlen($index); $n++) {
$i[] = substr($index, $n, 1);
}
$pass_hash = hash('sha256',$pass_key);
$pass_hash = (strlen($pass_hash) < strlen($index) ? hash('sha512', $pass_key) : $pass_hash);
for ($n = 0; $n < strlen($index); $n++) {
$p[] = substr($pass_hash, $n, 1);
}
array_multisort($p, SORT_DESC, $i);
$index = implode($i);
}
if ($to_num) {
// Digital number <<-- alphabet letter code
$len = strlen($in) - 1;
for ($t = $len; $t >= 0; $t--) {
@$bcp = bcpow($base, $len - $t);
@$out = $out + strpos($index, substr($in, $t, 1)) * $bcp;
}
if (is_numeric($pad_up)) {
$pad_up--;
if ($pad_up > 0) {
$out -= pow($base, $pad_up);
}
}
} else {
// Digital number -->> alphabet letter code
if (is_numeric($pad_up)) {
$pad_up--;
if ($pad_up > 0) {
$in += pow($base, $pad_up);
}
}
for ($t = ($in != 0 ? floor(log($in, $base)) : 0); $t >= 0; $t--) {
$bcp = bcpow($base, $t);
@$a = floor($in / $bcp) % $base;
$out = $out . substr($index, $a, 1);
@$in = $in - ($a * $bcp);
}
}
return $out;
}
//--
/* function PHP_UserData($data_request = array('value' => '', 'direct_query' => 0, 'loggedin' => true)){} */
//--
function PHP_Message_EMAIL($data = array()) {
global $load, $con, $mail, $options_launcher;
$smtp_or_mail = $options_launcher['smtp_or_mail'];
$smtp_host = $options_launcher['smtp_host'];
$smtp_username = $options_launcher['smtp_username'];
$smtp_password = $options_launcher['smtp_password'];
$smtp_encryption = $options_launcher['smtp_encryption'];
$smtp_port = $options_launcher['smtp_port'];
$email_from = $smtp_username;
$to_email = $data['to_email'] = PHP_Secure($data['to_email']);
$subject = $data['subject'];
$data['charSet'] = PHP_Secure($data['charSet']);
if (@$smtp_or_mail == 'mail') {
$mail->IsMail();
} else if (@$smtp_or_mail == 'smtp') {
$mail->isSMTP();
$mail->Host = $smtp_host;
$mail->SMTPAuth = true;
$mail->Username = $smtp_username;
$mail->Password = $smtp_password;
$mail->SMTPSecure = $smtp_encryption;
$mail->Port = $smtp_port;
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
} else {
return false;
}
$mail->IsHTML($data['is_html']);
$mail->setFrom($smtp_username, $data['from_name']);
$mail->addAddress($data['to_email'], $data['to_name']);
$mail->Subject = $data['subject'];
$mail->CharSet = $data['charSet'];
$mail->MsgHTML($data['message_body']);
if ($mail->send()) {
$mail->ClearAddresses();
return true;
}
}
//--
/* function PHP_UsernameExists($username = '') {
global $db;
return ($db->where('username', PHP_Secure($username))->getValue(T_USER, 'count(*)') > 0) ? true : false;
} */
//--
/* function PHP_UserEmailExists($username = '') {
global $db;
return ($db->where('email', PHP_Secure($username))->getValue(T_USER, 'count(*)') > 0) ? true : false;
} */
//--
function PHP_Install_rmdir() {
$files = glob('install/*'); //obtenemos todos los nombres de los ficheros
foreach($files as $file){
if(is_file($file))
unlink($file); //elimino el fichero
}
@rmdir('install');
}
//--
function PHP_fetchToken($form){
$token = md5(uniqid(microtime(), true));
$_SESSION['token'][$form] = $token;
// Just return it, don't echo and return
return $token;
}
//--
function PHP_matchToken($form){
if(!isset($_POST['token'][$form]))
return false;
// I would clear the token after matched
if($_POST['token'][$form] === $_SESSION['token'][$form]) {
$_SESSION['token'][$form] = NULL;
return true;
}
// I would return false by default, not true
return false;
}
//--
?>
Я не понимаю, почему это нормально на Xampp, но не на моем сервере. Я даже установил ту же версию PHP, что и в Xampp
Я не эксперт в этом, поэтому прошу кого-нибудь помочь
Спасибо
Изменить: Теперь после установки bcmath больше нет пустой страницы, но при перенаправлении страницы на домашнюю страницу по-прежнему не загружается страница / панель администратора.
Apache новая ошибка:
PHP Warning: require_once(/home/example/public_html/application/system/DB/vendor/composer/autoload_real.php): failed to open stream: No such file or directory in /home/example/public_html/application/system/DB/vendor/autoload.php on line 5
mod_fcgid: stderr: PHP Fatal error: require_once(): Failed opening required '/home/example/public_html/application/system/DB/vendor/composer/autoload_real.php' (include_path='.:/usr/share/php') in /home/example/public_html/application/system/DB/vendor/autoload.php on line 5
mod_fcgid: stderr: PHP Warning: require(/home/example/public_html/application/system/DB/vendor/composer/../joshcam/mysqli-database-class/MysqliDb.php): failed to open stream: No such file or directory in /home/example/public_html/application/system/DB/vendor/composer/autoload_real.php on line 66
mod_fcgid: stderr: PHP Fatal error: require(): Failed opening required '/home/example/public_html/application/system/DB/vendor/composer/../joshcam/mysqli-database-class/MysqliDb.php' (include_path='.:/usr/share/php') in /home/example/public_html/application/system/DB/vendor/composer/autoload_real.php on line 66
mod_fcgid: stderr: PHP Warning: require(/home/example/public_html/application/system/DB/vendor/composer/../joshcam/mysqli-database-class/MysqliDb.php): failed to open stream: No such file or directory in /home/example/public_html/application/system/DB/vendor/composer/autoload_real.php on line 66
mod_fcgid: stderr: PHP Fatal error: require(): Failed opening required '/home/example/public_html/application/system/DB/vendor/composer/../joshcam/mysqli-database-class/MysqliDb.php' (include_path='.:/usr/share/php') in /home/example/public_html/application/system/DB/vendor/composer/autoload_real.php on line 66
Это autoload_real. php
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit60bcbf6306fdeb83c78ecf96a45a2c2f
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit60bcbf6306fdeb83c78ecf96a45a2c2f', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit60bcbf6306fdeb83c78ecf96a45a2c2f', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit60bcbf6306fdeb83c78ecf96a45a2c2f::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit60bcbf6306fdeb83c78ecf96a45a2c2f::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire60bcbf6306fdeb83c78ecf96a45a2c2f($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire60bcbf6306fdeb83c78ecf96a45a2c2f($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}