我已经尝试将phpBB论坛集成到Codeigniter项目中。我已经将codeigniter(phpbb library)提供的库放在了projectName/application/ library中,并将论坛放在了项目的根目录下。控制器看起来像这样:
<?php
class Library_test extends CI_Controller
{
function __construct()
{
parent::__construct();
$this->load->database();
$this->load->library('session');
$this->load->library('phpbb_library');
}
function index()
{
if ($this->phpbb_library->isLoggedIn() === TRUE)
{
$userId = $this->phpbb_library->getUserInfo('user_id');
$username = $this->phpbb_library->getUserInfo('username');
echo "Welcome $username (" . ($this->phpbb_library->isAdministrator() === TRUE ? "administrator" : "user") . "), your ID is $userId and you are member of the following groups";
foreach ($this->phpbb_library->getUserGroupMembership() as $group)
{
echo "$group <br />";
}
}
else
{
echo "You are not logged-in.";
}
}
}
?>我已经为整个项目(chmod -R 777项目/)设置了适当的权限,错误显示为“找不到”的文件都在那里并且可以访问。请帮帮我。
以下是我试图访问控制器时出现的错误。
遇到PHP错误
严重性:警告
消息: include(localhost/communityCI/community/common.php):无法打开流:没有这样的文件或目录
文件名: libraries/phpbb.php
行号: 32
遇到PHP错误
严重性:警告
消息: include():无法打开包含(include_path='.:/usr/share/php:/usr/share/pear')的'localhost/communityCI/community/common.php‘
文件名: libraries/phpbb.php
行号: 32
遇到PHP错误
严重性:警告
消息: include(localhost/communityCI/community/config.php):无法打开流:没有这样的文件或目录
文件名: libraries/phpbb.php
行号: 33
遇到PHP错误
严重性:警告
消息: include():为包含(include_path='.:/usr/share/php:/usr/share/pear')打开'localhost/communityCI/community/config.php‘失败
文件名: libraries/phpbb.php
行号: 33
遇到PHP错误
严重性:警告
消息: include(localhost/communityCI/community/includes/functions_user.php):无法打开流:没有这样的文件或目录
文件名: libraries/phpbb.php
行号: 34
遇到PHP错误
严重性:警告
消息: include():无法打开包含(include_path='.:/usr/share/php:/usr/share/pear')的'localhost/communityCI/community/includes/functions_user.php‘
文件名: libraries/phpbb.php
行号: 34
遇到PHP错误
严重性:警告
消息: include(localhost/communityCI/community/includes/functions_display.php):无法打开流:没有这样的文件或目录
文件名: libraries/phpbb.php
行号: 35
遇到PHP错误
严重性:警告
消息: include():无法打开包含(include_path='.:/usr/share/php:/usr/share/pear')的'localhost/communityCI/community/includes/functions_display.php‘
文件名: libraries/phpbb.php
行号: 35
遇到PHP错误
严重性:警告
消息: include(localhost/communityCI/community/includes/functions_privmsgs.php):无法打开流:没有这样的文件或目录
文件名: libraries/phpbb.php
行号: 36
遇到PHP错误
严重性:警告
消息: include():无法打开包含(include_path='.:/usr/share/php:/usr/share/pear')的'localhost/communityCI/community/includes/functions_privmsgs.php‘
文件名: libraries/phpbb.php
行号: 36
遇到PHP错误
严重性:警告
消息: include(localhost/communityCI/community/includes/functions_posting.php):无法打开流:没有这样的文件或目录
文件名: libraries/phpbb.php
行号: 37
遇到PHP错误
严重性:警告
消息: include():无法打开包含(include_path='.:/usr/share/php:/usr/share/pear')的'localhost/communityCI/community/includes/functions_posting.php‘
文件名: libraries/phpbb.php
行号: 37
致命错误:在第39行对/var/www/communityCI/application/libraries/phpbb.php中的非对象调用成员函数session_begin()
发布于 2012-11-06 21:23:02
include(localhost/communityCI/community/common.php)
/var/www/communityCI/application/libraries/phpbb.php
您不应该从URL使用include;它很可能不起作用(就像您在这里看到的那样),并且不是一个好的实践。
使用文件的相对或绝对路径执行include:
include('/var/www/communityCI/community/common.php');你也不应该chmod 0777整个项目...
https://stackoverflow.com/questions/13245146
复制相似问题