第一步、把public所有文件复制到根目录 第二步、修改index.php和.htaccess
<?php
namespace think;
if (version_compare(PHP_VERSION, '7.1.0', '<')) {
echo '请升级您的PHP版本,要求:PHP >= 7.1.0,当前版本为 ' . PHP_VERSION;
exit;
}
require __DIR__ . '/vendor/autoload.php';
$http = (new App())->http;
$response = $http->run();
$response->send();
$http->end($response);
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1
</IfModule>
第三步、修改appdminconfig ilesystem.php
<?php
use thinkacadeEnv;
return [
'default' => Env::get('filesystem.driver', 'local'),
'disks' => [
'local' => [
'type' => 'local',
'root' => app()->getRuntimePath() . 'storage',
],
'public' => [
'type' => 'local',
'root' => app()->getRootPath() . '',
'url' => '',
'visibility' => 'public',
],
],
];
|