### composer安装访问出错解决方案
在thinkphp\\library\\think\\Loader.php第103行增加以下代码:
```
if (is_file(self::$composerPath . 'autoload_psr4.php')) {
$map = require self::$composerPath . 'autoload_psr4.php';
foreach ($map as $namespace => $path) {
$length = strlen($namespace);
self::$prefixLengthsPsr4[$namespace[0]][$namespace] = $length;
self::$prefixDirsPsr4[$namespace] = (array) $path;
}
}
```
### 在phpstudy下隐藏index.php
将public目录下的.htaccess换成以下代码:
```
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1]
</IfModule>
```
https://www.wenzhai8.com/