Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在cpanel中托管Laravel 5服务器错误500_Laravel_.htaccess_Laravel 5_Cpanel_Web Hosting - Fatal编程技术网

在cpanel中托管Laravel 5服务器错误500

在cpanel中托管Laravel 5服务器错误500,laravel,.htaccess,laravel-5,cpanel,web-hosting,Laravel,.htaccess,Laravel 5,Cpanel,Web Hosting,我已经将我的laravel项目文件夹上载到cpanel主机中。我在这里遵循了许多示例,但仍然得到了著名的500内部错误。这就是我所做的: 我在我的laravel项目中分离了公用文件夹,并将其放入了我的公用html文件夹中。我已将laravel项目的其余部分放入myapp文件夹 在我的public_html文件夹中,我更改了以下行: require __DIR__.'/../myapp/vendor/autoload.php'; /* |-----------------------------

我已经将我的laravel项目文件夹上载到cpanel主机中。我在这里遵循了许多示例,但仍然得到了著名的500内部错误。这就是我所做的:

我在我的laravel项目中分离了公用文件夹,并将其放入了我的公用html文件夹中。我已将laravel项目的其余部分放入myapp文件夹

在我的public_html文件夹中,我更改了以下行:

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

/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/

$app = require_once __DIR__.'/../myapp/bootstrap/app.php';
这是我的.env文件:

APP_NAME=Driveostle
APP_ENV=local
APP_KEY=base64:xxx
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://www.driveostle.ma
这是我的.htaccess文件:

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

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    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>

另外,在Cpanel中的PHP选择器版本中,我选择了7.1版本

在我的composer.json文件中:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.0.0",
        "fideloper/proxy": "~3.3",
        "intervention/image": "^2.4",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0",
        "mews/purifier": "^2.0"
    },
...
我不知道我的配置遗漏了什么,这是我第一次主持一个laravel网站,我希望我发布的内容能让你知道我遗漏了什么

如果您需要任何文件内容,我将很乐意发布


谢谢你

我在共享主机(cPanels)上部署了很多次我的Laravel应用程序,我创建了一个文档,这样我就可以帮助我的开发伙伴,试试这个


我多次在共享主机(cPanels)上部署我的Laravel应用程序,我创建了一个文档,以便帮助我的开发伙伴,尝试一下这个


您需要检查
存储/logs/laravel.log
或主机的错误日志。500错误的详细信息将在那里。您好,先生,在storage/logs/laravel.log中,我没有与500相关的任何错误,因为此文件的最后修改日期是上个月,因此我得出结论,此文件未受此影响。您需要检查
storage/logs/laravel.log
或主机的错误日志。500错误的详细信息将在那里。您好,先生,在storage/logs/laravel.log中,我没有与500相关的任何错误,因为此文件的最后修改日期是上个月,因此我得出结论,此文件未受此影响。谢谢您的文档,我做了完全相同的事情,我唯一错过的是filesystems.php,但仍然有500个错误。我可以知道您访问的路径吗?我可以知道你的routes/web.php文件的内容吗?谢谢你的文档,我做了完全相同的事情,我唯一错过的是filesystems.php,但仍然有500个错误。我可以知道你访问的路径是什么吗?我可以知道你的routes/web.php文件的内容吗?
<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
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@driveostle.ma 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.
{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=7.0.0",
        "fideloper/proxy": "~3.3",
        "intervention/image": "^2.4",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0",
        "mews/purifier": "^2.0"
    },
...