我刚刚在我的ubuntu计算机上安装了apache2和php5,我以前在debian上安装过,但现在我有一个奇怪的错误。
当我试图用CodeIgniter中的框架访问一个页面时,我得到了这个错误
[error] [client 127.0.0.1] PHP Warning: require_once(/var/www/project/system/core/CodeIgniter.php): failed to open stream: Permission denied in /var/www/project/index.php on line 202, referer: localhost/
[error] [client 127.0.0.1] PHP Fatal error: require_once(): Failed opening required '/var/www/project/system/core/CodeIgniter.php' (include_path='.:/usr/share/php5-common') in /var/www/project/index.php on line 202, referer: localhost/
在此之前,我在我的include_path上发现了一个错误,因此,我在php.ini上更改了它,并将其更改为:/usr/share/php5-common
不过。。。我不知道是什么错误。。。
我更改了我的/var/www文件夹及其类似用户的权限:用户
在index.php的行上,我有这样的:
require_once BASEPATH.'core/CodeIgniter.php';
很可能您的$config['base_url']
是错误的。请确保它正确标识了用于访问localhost的localhost或IP。我的意思是,如果您使用http://[ipaddress]访问本地服务器或远程服务器,那么您只需要这样定义baseurl。在您的情况下可能是**$config['base_url'] = http://127.0.0.1/codeigniter_project_name**
同样,这也适用于数据库配置。