tp5.0 问题
1.【LNMP】提示Nginx PHP “No input file specified”错误的解决办法
https://www.cnblogs.com/richerdyoung/p/7209588.html
2. 关于第三方css样式失效问题
检查是否本地得第三方资源文件上传至服务器 (如一些static,lib下的 css,js文件)
3.关于主页跳转其他页面出现404 问题
检查nginx 配置问题,贴出配置,( location / 位置)
server
{
listen 80;
#listen [::]:80;
server_name xzh.wangjingye.top;
index index.html index.htm index.php;
root /xzh/web/xzh/public;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
# rewrite ^/tp5/(.*)$ /tp5/index.php/$1 last;
break;
}
}
location ~ \.php {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fastcgi_params;
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
#set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME
$document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
#fastcgi_param PATH_INFO $path_info;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
access_log /xzh/web/xzh.log;
}
tp 3.2 问题
1.服务器配置完好,部署tp3.2的项目 TP3.2的URL重写省略index.php问题,和 404 问题
在tp3中,如果使用了默认的路由,我们的url可能会变成 http://www.baidu.com/index.php/index/index/index
(1)确定自己的框架已经配置好
在tp3框架的配置文件里,明确指定了路由的格式,这个配置位于thinkPHP文件夹下的conf文件夹里的convention.php中,修改以下字段 'URL_MODEL' => 2, #URL访问模式,可选参数0、1、2、3,代表以下四种模式
入口文件同一级的目录下创建一个.htaccess的文件
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
</IfModule>