1.主要是配置nginx伪静态
#这里是伪静态,必须配置的,配置完重启nginx
location / {
try_files $uri $uri/ /index.php$is_args$args;
index index.php index.html index.htm;
if (!-e $request_filename) {
#rewrite ^(.*)$/index.php?s=/$1 last;
rewrite ^(.+?\.php)(/.+)$ /$1?s=$2 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
2.php.ini文件和项目public下面.user.ini
#需要注意的是一定要配置正确,而且两个地方都要配置,配置完要重启php
#如果报错信息是open_basedir什么的就把那个地址加.user.ini和php.ini上,注意用:分开不同的地址
open_basedir=/var/www/sc_php/sc_php/:/tmp/:/proc/:/var/tmp/:/usr/local/Cellar/composer/1.8.6/bin/composer:/Users/cailiguang/.composer:/usr/local/etc/openssl/cert.pem
3.如果是本地的话最好把项目权限给成777
4.需要注意的是如果你本地的其他项目原来是正常的,现在突然用不了(报错No input file specified.),可以把php.ini中open_basedir注释掉
网友评论