如果我在public_html
内有整个Laravel项目,我必须转到http://domain.com/public
才能访问它,但如果我将Laravel的public
内容放在public_html
中,Laravel中的其余文件将查找名为public
的文件夹,现在称为public_html
。
另外,如果我将public_html
重命名为public
,它也无效。
我已尝试在'public' => __DIR__.'/../public
'public' => __DIR__.'/../public_html'
更改为/bootstrap/paths.php
当我尝试加载http:/domain.com
时,它说:
Warning: require() [function.require]: open_basedir restriction in effect. File(/home/domain/bootstrap/autoload.php) is not within the allowed path(s): (/home/domain/public_html:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/domain/public_html/index.php on line 21
Warning: require(/home/domain/bootstrap/autoload.php) [function.require]: failed to open stream: Operation not permitted in /home/domain/public_html/index.php on line 21
Fatal error: require() [function.require]: Failed opening required '/home/domain/public_html/../bootstrap/autoload.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/domain/public_html/index.php on line 21
'public' => __DIR__.'/../public
上的'public' => __DIR__.'/../www'
至/bootstrap/paths.php
无法正常工作
答案 0 :(得分:0)
支持禁用open_basedir限制,所以我再次将路径从public更改为public_html,现在可以正常工作,也不需要.htaccess魔法。