安装Laravel 5.3后出现错误500

时间:2017-11-12 20:22:26

标签: php laravel ssh

我有一个Laravel项目(版本5.3),在我的localhost(wampserver)上运行良好。

现在我想在我的网站的子域上运行这个项目。我有ssh root访问权限和vps用户访问权限(不是admin - 使用Directadmin - PHP版本5.4)。

我将项目文件上传到我的服务器,但是当我尝试查看项目结果时,它给出了500错误。

我试图改变存储空间'文件夹权限,所以我读了this answer,但当我运行" chchon" ssh命令,我得到这样的错误:

can't apply partial context to unlabeled file ...

另外,我已经用4.2版对Laravel进行了测试,效果很好。

有男孩有想法吗?感谢

2 个答案:

答案 0 :(得分:0)

如果您未启用SELinux,则只需使用chmod设置权限,或者将chown的存储目录的所有者设置为Web服务器的用户。 (可能是www-data)
尝试在项目目录中运行sudo chown -R www-data storage

答案 1 :(得分:0)

尝试所有这些

// first delete the vendor folder inside your project root, then run
 composer install     

// laravel generates log file there
 sudo chmod -R 777 storage/logs

// laravel cache the files here
 sudo chmod -R 777 bootstrap/cache 

// vendor folder, where laravel saves their dependencies
 sudo chmod -R 777 storage/ vendor/

// generate a application key
 php artisan key:generate

这可能会有所帮助:)