Php Laravel路径在localhost中不起作用,但在cpanel上完全正常

Php Laravel路径在localhost中不起作用,但在cpanel上完全正常,php,laravel,.htaccess,localhost,cpanel,Php,Laravel,.htaccess,Localhost,Cpanel,提前谢谢你的帮助。 我是新来的拉威尔,我正在做这个项目,同时学习拉威尔。正如我在标题中所写的,当项目和文件在Cpanel上时,它在实时主机上加载良好。但是,当我下载它时,文件不起作用。我找到了一个解决办法,但并不好。这些路径不起作用。我的解决方案是遍历每个文件并更改路径,但这需要时间 它在cpanel上工作的原因是因为.htaccess文件吗?htaccess的代码在这里- <IfModule mod_rewrite.c> <IfModule mod_negot

提前谢谢你的帮助。 我是新来的拉威尔,我正在做这个项目,同时学习拉威尔。正如我在标题中所写的,当项目和文件在Cpanel上时,它在实时主机上加载良好。但是,当我下载它时,文件不起作用。我找到了一个解决办法,但并不好。这些路径不起作用。我的解决方案是遍历每个文件并更改路径,但这需要时间

它在cpanel上工作的原因是因为.htaccess文件吗?htaccess的代码在这里-

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

    RewriteEngine On

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

    # 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]
</IfModule>
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

<IfModule php7_module>
   php_flag display_errors Off
   php_value max_execution_time 60
   php_value max_input_time 120
   php_value max_input_vars 3000
   php_value memory_limit 256M
   php_value post_max_size 16M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php74"
   php_value upload_max_filesize 20M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 60
   php_value max_input_time 120
   php_value max_input_vars 3000
   php_value memory_limit 256M
   php_value post_max_size 16M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php74"
   php_value upload_max_filesize 20M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
Server.php-

    <?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}

require_once __DIR__.'/public/index.php';

    <?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylor@laravel.com>
 */

$uri = urldecode(
    parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
);

// This file allows us to emulate Apache's "mod_rewrite" functionality from the
// built-in PHP web server. This provides a convenient way to test a Laravel
// application without having installed a "real" web server software here.
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
    return false;
}

require_once __DIR__.'/public/index.php';