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条)

报告相同问题?

悬赏问题

  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R