簡體   English   中英

Laravel 5.5在Godaddy上。 產生錯誤500。內部服務器錯誤

[英]Laravel 5.5 on Godaddy. Producing error 500. internal server Error

我已經將laravel文件上傳到Godaddy共享主機。

我的文件夾結構是這樣的

/mediservices
    all-other-laravel-files-and-folders

/public_html
    public
       index.php

已將public_html中public文件夾中index.php的內容編輯為指向medsirvices文件夾,如下所示-

22. require __DIR__.'/../../mediservices/bootstrap/autoload.php';
34. $app = require_once __DIR__.'/../../mediservices/bootstrap/app.php';

我已將以下內容添加到public_html文件夾中的.htaccess文件中

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{REQUEST_URI} !^mediservices
 RewriteRule ^(.*)$ mediservices/$1 [L]
</IfModule>

轉到域時,我仍然收到500 Internal Server Error。

完整的消息是

Internal Server Error
The server encountered an internal error or misconfiguration and was 
unable to complete your request.

Please contact the server administrator at webmaster@medcommhospital.com 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.

在評論之后,我可以提出以下建議。 如果要在站點根目錄下或站點上的文件夾下提供站點服務,則需要明確說明。

密切注意您的日志,它們會告訴您問題所在。 並確保它實際上是相同的錯誤,即使是很小的細節更改也可以為您提供更多信息。

在站點根目錄下服務站點

如果要在域根目錄下托管您的site / Laravel項目,請在example.org/進行如下配置。

# Contains  all other laravel files
mediservices/
  ...

public_html/ <webserver root> <laravel public dir>
  index.php
  .htaccess

您對index.php的引導程序的引用應該是。

__DIR__ . '/../mediservices/bootstrap/autoload.php'

您的.htaccess文件不需要重寫規則,因此您可以刪除該配置。

服務網站在域上的文件夾下

但是,如果您希望從URL中域部分之后的文件夾mediservices/提供服務,例如example.org/mediservices/ ,並將用戶重定向到該文件夾​​,則可以保留.htaccess重寫規則,但是您可以必須將您的Laravel公用文件夾移動到以下位置:

# Contains  all other laravel files
mediservices/
  ...

public_html/ <webserver root>
  mediservices/ <laravel public dir>
    index.php
  .htaccess <should stay under the public_html/ folder>

您在index.php使用的引用應該與您使用的一樣,如下所示。

__DIR__ . '/../../mediservices/bootstrap/autoload.php'

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM