我想部署我的Laravel项目,但它总是向我显示此错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
我的服务器结构是这样的:
/
/protected --> All Files and Folders within the project (+ /node_modules & /vendor) except the /public-folder
/public_html --> all Files and Folders within the /public-folder
我已经更改了/ storage-folder的权限,并且已经将/index.php中的路径更改为
require __DIR__.'/../protected/vendor/autoload.php';
和
$app = require_once __DIR__.'/../protected/bootstrap/app.php';
有什么想法吗?
答案 0 :(得分:1)
将所有文件从本地主机(htdocs)放置到public_html。另外,请确保托管服务器上的域重定向中没有任何重定向。 内部服务器错误的主要原因是您的域没有指向您定义的目录。
就我而言,index.php文件是
需要 DIR 。'/ .. / vendor / autoload.php';
$ app = require_once DIR 。'/ .. / bootstrap / app.php';
一个接一个地进行所有更改,这有望在您的情况下起作用。我已经在下面提到了参考链接,请检查
https://laracasts.com/discuss/channels/laravel/laravel-deploying-to-server-using-ftp