环境:win10、phpstudy8.1.1.2、yii2
一、采用apche、mysql伪静态设置
phpstudy: 网站->对应的网站->修改->伪静态 添加以下代码
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
二、采用ngix、mysql伪静态设置
phpstudy: 网站->对应的网站->修改->伪静态 添加以下代码
location / {
# Redirect everything that isn't a real file to index.php
try_files $uri $uri/ /index.php$is_args$args;
}
以上方法在笔记本的win10家庭中文版上测试成功,但是在台式机同样的环境下竟然没有成功,提示failed opend required。是不是台式机的win10专业版在ghost安装的时候是精简版的原故呢,网上没有找到任何答案
四、以下错误提示(竟然不是设置环境问题哦,而是确实没有vendor这个文件夹的文件,害我好找。也就是说当某种思路在网上确实找不到答案就需要换个思路了。一般网上都可以找到答案):
Warning: require(D:\wwwroot\www.a11.cc\web/../vendor/autoload.php): failed to open stream: No such file or directory in D:\wwwroot\www.a11.cc\web\index.php on line 7
Fatal error: require(): Failed opening required 'D:\wwwroot\www.a11.cc\web/../vendor/autoload.php' (include_path='.;C:\php\pear') in D:\wwwroot\www.a11.cc\web\index.php on line 7

6020

被折叠的 条评论
为什么被折叠?



