大家好,我有一个用 codeigniter 开发的网站,我想将一些我在许多页面中使用的 javascript/PHP 函数存储到一个名为 common.php 的文件中。我尝试过这种模式:
require(base_url().'application/libraries/common.php'); //I have tried also include
这给我这个错误:
A PHP Error was encountered
Severity: Warning
Message: require() [function.require]: http:// wrapper is disabled in the server configuration by allow_url_include=0
我要去我的php.ini并打开allow_url_include,重新启动apache,当我尝试加载页面时,现在返回这个错误:
A PHP Error was encountered
Severity: Warning
Message: require() [function.require]: http:// wrapper is disabled in the server configuration by allow_url_include=0
Filename: backend/hotel_view.php
Line Number: 6
A PHP Error was encountered
Severity: Warning
Message: require(http://demo.webanddesign.it/public/klikkahotel.com/application/libraries/common.php) [function.require]: failed to open stream: no suitable wrapper could be found
Filename: backend/hotel_view.php
Line Number: 6
Fatal error: require() [function.require]: Failed opening required 'http://demo.webanddesign.it/public/klikkahotel.com/application/libraries/common.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/public/klikkahotel.com/application/views/backend/hotel_view.php on line 6
我可以做些什么来将一个简单的文件包含到我的页面中?