duan0414
2017-12-13 03:08
浏览 83
已采纳

Cpanel共享主机中的Laravel 5.5 Error 500

I already upload my laravel project folder into cpanel hosting. I did't have VPS. I has read many example in laracast and stackoveflow, but still get this 500 internal error. This is my setting.

I has separated public folder in my laravel project and put the other in root directory of my hosting like this.

|-- my_other_folder_project/
|-- [some other folders...]
|-- public_html/ 
|   |-- [some other folders...]
|   |-- my_public_project/

And Change index.php setting into :

from

require __DIR__.'/../vendor/autoload.php';

to

require __DIR__.'/../../my_other_folder_project/vendor/autoload.php';

And From

$app = require_once __DIR__.'/../bootstrap/app.php';

to

$app = require_once __DIR__.'/../../my_other_folder_project/bootstrap/app.php';

I has create .htaccess file for public folder like this :

DirectoryIndex index.php

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

My PHP for this is 7.1 and I've checked other requirenment like OpenSSL, PDO, Mbstring, Tokenizer Already installed.

But Still get this 500 internal server error, I've searching many refference for this but pointed to the step I've already do.

图片转代码服务由CSDN问答提供 功能建议

我已将laravel项目文件夹上传到cpanel主机。 我没有VPS。 我在laracast和stackoveflow中读过许多例子,但仍然得到这500个内部错误。 这是我的设置。

我在laravel项目中分隔了公共文件夹,并将另一个放在我的托管的根目录中,就像这样。

  |  -  my_other_folder_project / 
 |  -  [其他一些文件夹...] 
 |  -  public_html / 
 |  |  -  [其他一些文件夹...] 
 |  |  -  my_public_project / 
   
 
 

并将index.php设置更改为:

 需要__DIR __。'/ .. / vendor / autoload.php'; 
   
 
 

   require __DIR __。'/ .. / .. / my_other_folder_project / vendor / autoload.php'; 
   
 
 

From

  $ app = require_once __DIR __。'/ .. / bootstrap / app.php'; 
   
 
 

to

  $ app = require_once __DIR __。'/ .. / .. / my_other_folder_project / bootstrap / app.php'; 
   
 
 

我已创建。 公共文件夹的htaccess文件,如下所示:

  DirectoryIndex index.php 
 
&lt; IfModule mod_rewrite.c&gt; 
&lt; IfModule mod_negotiation.c&gt; 
选项-MultiViews  
&lt; / IfModule&gt; 
 
 RewriteEngine On 
 
#重定向尾随斜杠如果不是文件夹... 
 RewriteCond%{REQUEST_FILENAME}!-d 
 RewriteRule ^(。*)/ $ / $ 1  [L,R = 301] 
 
#句柄前控制器... 
 RewriteCond%{REQUEST_FILENAME}!-d 
 RewriteCond%{RE  QUEST_FILENAME}!-f 
 RewriteRule ^ index.php [L] 
 
#Handle Authorization Header 
 RewriteCond%{HTTP:Authorization}。
 RewriteRule。*  -  [E = HTTP_AUTHORIZATION:%{HTTP:Authorization}  ] 
&lt; / IfModule&gt; 
   
 
 

我的PHP为7.1,我检查了其他需求,如OpenSSL,PDO,Mbstring,Tokenizer已安装。

但仍然得到这500个内部服务器错误,我已经为此搜索了许多参考,但指出了我已经做过的步骤。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

相关推荐 更多相似问题