首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP致命错误:需要量()

PHP致命错误:需要量()
EN

Stack Overflow用户
提问于 2016-01-13 03:22:21
回答 1查看 1.9K关注 0票数 2

我有一个网站在我的本地主机上运行得很好,但是.我把它上传到了几个免费的网站托管(2000网站主机和主机),当我试图打开它时,收到了以下消息:

警告:require(core/libs/smarty/S节.class.php):未能打开流:在第7行/home/u327900732/public_html/www/index.php中没有这样的文件或目录 致命错误:要求():在/home/u327900732/public_html/www/index.php第7行中的/home/u327900732/public_html/www/index.php(包括_path=.:/opt/php-5.5/pear‘)中的打开失败要求’core/libs/smarty/S烈士.class.php‘

这是代码:

代码语言:javascript
复制
    <?php   

session_start();

$view = isset($_GET['view']) ? $_GET['view'] : 'index';

require_once('core/libs/smarty/Smarty.class.php');
require('core/models/class.Conexion.php');

if(file_exists('core/controllers/'.$view.'Controller.php')){
    include('core/controllers/'.$view.'Controller.php');
}else {
    include('core/controllers/errorcontroller.php');
}

?>

我查了一百遍那份文件就在那儿。

我找到并尝试了这个解决方案:

  • 更改要求包括:

警告:include(core/libs/smarty/S节.class.php):未能打开流:在第7行/home/u327900732/public_html/www/index.php中没有这样的文件或目录 警告: include():未能在第7行的/home/u327900732/public_html/www/index.php中打开‘core/libs/smarty/s烈士.class.php’以便包含(include_path=.:/opt/php-5.5/pear‘)。 致命错误:在第3行的/home/u327900732/public_html/www/core/controllers/indexController.php中找不到'Smarty‘类

  • require(chdir(dirname(FILE))。‘’core/libs/睿智/S烈士.class.php‘);

警告:require(1 1core/libs/smarty/S节.class.php):未能打开流:在第7行/home/u327900732/public_html/www/index.php中没有这样的文件或目录 致命错误:要求():在第7行的/home/u327900732/public_html/www/index.php中,打开失败需要‘1 1core/libs/smarty/s烈士.class.php’(包括_path=.:/opt/php-5.5/pear‘)。

  • 更改第7行 require_once($_SERVER'DOCUMENT_ROOT'.'/core/libs/smarty/Smarty.class.php');

警告: require_once(/home/u327900732/public_html/core/libs/smarty/Smarty.class.php):未能打开流:第7行/home/u327900732/public_html/www/index.php中没有这样的文件或目录 致命错误:'/home/u327900732/public_html/core/libs/smarty/Smarty.class.php‘():打开失败需要在/home/u327900732/public_html/www/index.php第7行中的/home/u327900732/public_html/www/index.php中使用require_once(包含_path=’.:/opt/php-5.5/pear‘)

我试着在这条路上加上“./”,但它仍然不起作用。重复一遍,这个网站在我的本地主机上运行得很好。救命啊!

EN

回答 1

Stack Overflow用户

发布于 2016-01-13 03:42:01

尝试使用完整的url来测试您的url。或者在浏览器中签入以检查文件是否存在。就像这里:

http://host.com/core/libs/smarty/Smarty.class.php

我认为它会显示错误,显示您的文件不存在。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/34757856

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档