http://localhost/api.html
Ex.
1 2 3 4 5 | success |
在 ThinkPHP/Common/common.php 中
require_array($array,$return=false) 呼叫 require_cache()的
require $filename; // $filename:./app/Lib/Action/MyAction.class.php
經過這行後就開始產生空行
原來是./app/Lib/Action/MyAction.class.php 這隻檔案我在<?php ... ?> 之後多寫了很多空白行造成的
MyAction.class.php:
1 2 3 4 5 6 7 8 | < php ? ... ?> <= 多出的空行 |
execute和query方法的区别
http://blog.csdn.net/chamtianjiao/article/details/6405951
excute() - insert or update
query() - select
$model = new Model();
$result = $model ->execute( 'select * from MyTable' ); //将返回总行数
$result = $model ->query( 'select * from MyTable' ); //将返回array()
Nginx 下實現ThnkPHP 的 pathinfo模式
癥狀:
http://www.thinkphp.cn/topic/21478.html
除了首頁外全顯示404 Not Found ( Linux + Nginx環境 )
http://www.aaa.com/index.php => 能夠顯示
http://www.aaa.com/index.php/User/login => 顯示 404
解法:
http://www.thinkphp.cn/topic/3138.html
編輯該站的配置文件( sites-available/www.aaa.com.conf ) location ~ \.php$ { 將$去掉 location ~ \.php { ,去掉$是為了不匹配行末,即可以匹配.php/,以實現pathinfo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | location ~ \.php { # 原有代碼 ##pathinfo支持start #定義變數 $path_info ,用於存放pathinfo資訊 set $path_info "" ; #定義變數 $real_script_name,用於存放真真實位址 set $real_script_name $fastcgi_script_name; #如果地址與引號內的規則運算式匹配 if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$" ) { #將檔位址賦值給變數 $real_script_name set $real_script_name $1; #將檔位址後的參數賦值給變數 $path_info set $path_info $2; } #配置fastcgi的一些參數 fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param SCRIPT_NAME $real_script_name; fastcgi_param PATH_INFO $path_info; ###pathinfo支持end } |
避免xdebug在chrome斷點兩次
https://stackoverflow.com/a/42012288 How to do not redirect specific file on nginx?
https://segmentfault.com/a/1190000007411139 nginx的favicon配置
寶塔中thinkphp的偽靜態預設配置是:
location / {
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
但是這樣會造成Chrome的 favicon.ico 的也會進入斷點,把偽靜態設置改成
location / {
location ~ ^/favicon\.ico$ {
root www;
}
if (!-e $request_filename){
rewrite ^(.*)$ /index.php?s=$1 last; break;
}
}
沒有留言:
張貼留言