Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 部署到VPS服务器时,代码点火器系统文件中出现异常错误_Php_Codeigniter - Fatal编程技术网

Php 部署到VPS服务器时,代码点火器系统文件中出现异常错误

Php 部署到VPS服务器时,代码点火器系统文件中出现异常错误,php,codeigniter,Php,Codeigniter,最近,我在WAMP本地服务器上使用CodeIgniter完成了我的站点的构建,并在共享主机服务器上进行了测试(来自namescape)。然后我得到了VPS托管计划(来自iPage),上传了文件并进行了必要的配置。但是,当我尝试访问该站点时,出现了以下错误: 遇到未捕获的异常 类型:错误 消息:调用未定义的函数ctype_digit() 文件名:/home/eastngco/public_html/system/core/Security.php 电话号码:600 问题是,可疑文件Security

最近,我在WAMP本地服务器上使用CodeIgniter完成了我的站点的构建,并在共享主机服务器上进行了测试(来自namescape)。然后我得到了VPS托管计划(来自iPage),上传了文件并进行了必要的配置。但是,当我尝试访问该站点时,出现了以下错误:

遇到未捕获的异常

类型:错误

消息:调用未定义的函数ctype_digit()

文件名:/home/eastngco/public_html/system/core/Security.php

电话号码:600

问题是,可疑文件Security.php是一个代码点火器系统文件,我从未处理过它(我写的所有东西都在应用程序文件夹中)。下面是Security.php中导致错误的一行代码片段:

/**
 * Get random bytes
 *
 * @param   int $length Output length
 * @return  string
 */
public function get_random_bytes($length)
{
    if (empty($length) OR ! ctype_digit((string) $length))
    {
        return FALSE;
    }

    if (function_exists('random_bytes'))
    {
        try
        {
            // The cast is required to avoid TypeError
            return random_bytes((int) $length);
        }
        catch (Exception $e)
        {
            // If random_bytes() can't do the job, we can't either ...
            // There's no point in using fallbacks.
            log_message('error', $e->getMessage());
            return FALSE;
        }
    }

    // Unfortunately, none of the following PRNGs is guaranteed to exist ...
    if (defined('MCRYPT_DEV_URANDOM') && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE)
    {
        return $output;
    }


    if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE)
    {
        // Try not to waste entropy ...
        is_php('5.4') && stream_set_chunk_size($fp, $length);
        $output = fread($fp, $length);
        fclose($fp);
        if ($output !== FALSE)
        {
            return $output;
        }
    }

    if (function_exists('openssl_random_pseudo_bytes'))
    {
        return openssl_random_pseudo_bytes($length);
    }

    return FALSE;
}
我不知道随机字节或ctype_digit()是什么意思

我在网上做了一些挖掘,看看是否会出现类似的问题(及其解决方案),但什么都没有。我需要帮忙修理这个。
如果这意味着什么的话,我的托管计划附带的PHP版本是版本7,我有SSL

看起来您的提供程序可能已显式禁用了这些类型的函数。默认情况下应该启用它。请尝试联系您的提供商以获得有关启用这些功能的支持,或者在不关闭该标志的情况下重新安装PHP


此外,您可以尝试检查
phpinfo()
页面以确认是否启用了ctypes。他们将其关闭似乎很奇怪,因此这将有助于确定这是否是问题的一部分。

我认为VPS的重点是您控制服务器?您可能需要启用ctype函数并重新启动apache。请原谅我的无知,但我真的不知道如何做到这一点。这是我第一次使用VPSWhat操作系统?什么版本的操作系统?Web服务器是Apache还是nginx?您作为root用户有命令行访问权限吗?很抱歉,我无法提前回复。我联系了我的web主机并启用了ctype,但问题仍然存在。操作系统是CentOS 6.4 x86_64。ApacheWebServer。我已经联系了我的web主机,他们为我启用了ctype,但问题仍然存在,我后来找到了d bug的来源。它与fingered文件无关,而是我的.htaccess文件