apeblog/public/doc/常见问题.md

72 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 常见问题
1、安装失败可能存在php配置文件禁止了`putenv`和`proc_open`函数。解决方法,查找`php.ini`文件位置,打开`php.ini`,搜索`disable_functions`项,看是否禁用了`putenv` 和`proc_open`函数。如果在禁用列表里,移除`putenv` `proc_open`然后退出重启php即可。
2、如果安装后打开页面提示`404`错误,请检查服务器伪静态配置,如果是宝塔面板,网站伪静态请配置使用`thinkphp规则`。
**伪静态配置如下:**
**Nginx**
修改nginx.conf 配置文件 加入下面的语句。
```shell
location /admin/ {
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/admin/(.*)$ /admin.php?s=$1;
}
}
location /api/ {
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/api/(.*)$ /api.php?s=$1;
}
}
location / {
index index.php index.html index.htm;
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=$1 last;
}
}
```
**Apache**
把下面的内容保存为.htaccess文件放到应用入 public 文件的同级目录下。
```shell
<IfModule mod_rewrite.c>
Options +FollowSymlinks -Multiviews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^admin/(.*)$ admin.php?s=$1;
RewriteRule ^api/(.*)$ api.php?s=$1;
RewriteRule ^(.*)$ index.php?s=$1 [L]
</IfModule>
```
3、如果提示当前权限不足无法写入配置文件`config/database.php`,请检查`database.php`是否可读还有可能是当前安装程序无法访问父目录请检查PHP的`open_basedir`配置。
4、如果`composer install`失败,请尝试在命令行进行切换配置到国内源,命令如下:
```shell
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
```
复制
5、如果`composer install`失败请尝试composer降级
```shell
composer self-update
```
复制
6、如果`composer install`失败,请尝试删除项目文件,重新拉取。
7、访问 [http://www.yoursite.com/install/index](http://www.yoursite.com/install/index) ,请注意查看伪静态请配置是否设置了`thinkphp规则`。
8、遇到问题请到QQ**1099438829** 反馈,或者到**Issue**里面反馈,谢谢!