如何在传统的Web主机上组织Laravel的文件夹?

时间:2014-03-16 02:27:12

标签: apache url laravel hosting directory

如果我在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无法正常工作

1 个答案:

答案 0 :(得分:0)

支持禁用open_basedir限制,所以我再次将路径从public更改为public_html,现在可以正常工作,也不需要.htaccess魔法。