最近,我遇到了一个问题:
Warning:include(C:\xampp\htdocs\crackverbal\application\views\errors\html\error_php.php): failed to open stream: No such file or directory in C:\xampp\htdocs\crackverbal\system\core\Exceptions.php on line 269
Warning: include(): Failed opening 'C:\xampp\htdocs\crackverbal\application\views\errors\html\error_php.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\crackverbal\system\core\Exceptions.php on line 269
Warning: include(C:\xampp\htdocs\crackverbal\application\views\errors\html\error_php.php): failed to open stream: No such file or directory in C:\xampp\htdocs\crackverbal\system\core\Exceptions.php on line 269
Warning: include(): Failed opening 'C:\xampp\htdocs\crackverbal\application\views\errors\html\error_php.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\crackverbal\system\core\Exceptions.php on line 269我使用了Xampp和codeigniter-3。
发布于 2016-07-21 10:53:16
我猜
在application\view\errors\html\文件夹下,或下不存在error_php.php文件
在application\view\文件夹下,errors文件夹根本不存在。
您可以创建虚拟文件并查看是否有任何错误。
在application/view/下,创建名为errors的文件夹。
然后在errors文件夹中,创建名为html的文件夹
然后在html文件夹中,创建名为error_php.php的php文件
在error_php.php中,
<?php echo "Sample text."; ?>发布于 2019-03-07 00:03:10
从"codeigniter3/application/views"复制"errors"文件夹并将其粘贴到您的项目("my_project/application/views")中。
将以下代码粘贴到index.php中
$view_folder = '';
// The path to the "views" folder
if ( ! is_dir($view_folder))
{
if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
{
$view_folder = APPPATH.$view_folder;
}
elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG
}
else
{
$view_folder = APPPATH.'views';
}
}
if (($_temp = realpath($view_folder)) !== FALSE)
{
$view_folder = $_temp.DIRECTORY_SEPARATOR;
}
else
{
$view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR;
}
define('VIEWPATH', $view_folder);发布于 2017-06-05 17:35:55
只需将codeigniter应用程序中的错误文件夹复制到codeigniter视图文件夹即可。它将纠正错误的页面路径。警告将被删除。
https://stackoverflow.com/questions/38431340
复制相似问题