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.

  • 写回答

3条回答 默认 最新

  • douxin2003 2017-12-14 02:24
    关注

    First time, you can check your php info

    <?php
    phpinfo();
    ?>
    

    and you can search "mbstring" in there...

    mbstring

    if mbstring still not installed, you can ask the provider to installed that.

    if already installed and still got the error 500, better you must check your php version in phpinfo(). And clear your cache with php artisan command. when you have a permission to shell, you can try to check your php version with command "php -v" and see the default php with which php.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 LiBeAs的带隙等于0.997eV,计算阴离子的N和P
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 来真人,不要ai!matlab有关常微分方程的问题求解决,
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算