Time of Update: 2016-08-08
本節內容:nginx與apache的優缺點一、nginx相對於apache的優點: 輕量級,同樣起web 服務,比apache伺服器佔用更少的記憶體及資源 抗並發,nginx在處理請求是非同步非阻塞的,而apache 則是阻塞型的,在高並發下nginx 能保持低資源低消耗高效能 高度模組化的設計,編寫模組相對簡單 社區活躍,各種高效能模組出品迅速啊 apache 相對於nginx 的優點: rewrite ,比nginx 的rewrite 強大 動態網頁面模組超多,基本想到的都可以找到
Time of Update: 2016-08-08
max os x安裝 php,使用brew 安裝,一直提示 checking for gzgets in -lz... yeschecking whether to enable bc style precision math functions... yeschecking for BZip2 support... yeschecking for BZip2 indefault path... notfoundconfigure: error: Please reinstall the
Time of Update: 2016-08-08
php通過如下方式調用memcache存放session的時候,記得需要把/usr/local/php/etc/php.ini中的session.auto_start = 0 設定為0 ,否則調用memcache儲存session,是不生效的。原因是:在php執行第一行的時候回自動啟動session,而且預設的是files,所以預設就會通過檔案儲存session,而在之後配置的ini_set 就沒有用了。// session設定方式一:這種方式
Time of Update: 2016-08-08
為了學習高效能並發伺服器,打算研究一下Nginx的實現。按照慣例,最開始都要寫一個hello world的程式,所以接下來就是介紹如何在Nginx的架構下編寫一個簡單的HTTP模組來列印”Hello
Time of Update: 2016-08-08
零. 聲明:以下內容適用於linux環境下,採用源碼方式安裝Nginx官網安裝指南:http://wiki.nginx.org/InstallChs一. 下載nginx1.官網下載:http://nginx.org/en/download.html 2.Git下載:https://github.com/nginx/nginx二. 必要的依賴庫1.pcreyum -y install pcre* #nginx rewrite模組2.gccyum -y install gcc gcc-c++
Time of Update: 2016-08-08
1.Nginx設定檔測試root@kallen:/usr/local/nginx/sbin# nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful2.Nginx啟動[root@kallen ~]# /usr/local/nginx/sbin/nginx
Time of Update: 2016-08-08
使用thinkphp 的時候 表單裡的name 名稱 必須要和資料庫裡的名稱相同 這樣才能把資料插入到資料庫中,為了更加安全有時候我們不想讓別人知道資料庫中的欄位名 這時我們就可以使用thinkphp的欄位對應namespace Home\Model;use Think\Model;class UserModel extends Model{ proceted $_map(){ "name"=>"username"; //把表單中的name 映射到
Time of Update: 2016-08-08
//thinkphp 資料庫操作//配置 數組形式 採用普通配置和資料庫配置兩數組合并 $arr1=array( //'配置項'=>'配置值' //url pathinfo 的4種方法0,1,2,3常用0,1 "URL_MODEL"=>0, //URL_PATHINFO普通模式 "URL_PATHINFO_MODEL"=>2,);$arr2=array( //資料庫配置 'DB_TYPE' => '
Time of Update: 2016-08-08
我想要的是 訪問 news.test.com , 實際訪問的是 tomcat 下面的news 項目 ,訪問 forum.test.com ,實際訪問的是 tomcat 下面的 luntan 項目,但是瀏覽器地址 欄url news.test.com 、forum.test.com 不變 ,不要變成 news.test.com/news 或者 forum.test.com/luntan 這樣的,如何配置? 請教謝謝各位的回答,已經解決了。 需要在tomcat裡面配置虛擬host。
Time of Update: 2016-08-08
對excel表格進行操作,要用到PHPExcel外掛程式。由於我一般都用的是CI架構,以CI架構來介紹。首先要引入PHPExcel的相關檔案:$this->load->library('PHPExcel/IOFactory');$this->load->model('search_model');接下來介紹怎麼匯出excel檔案,首先要建立工作表,並對它進行初始化://建立工作表$objPHPExcel = new PHPExcel();//
Time of Update: 2016-08-08
曆經兩周構思與取材,兩天編寫代碼,程式遠表白網V1.0版已經上線啦。網址:http://www.kangry.net/love/。整合了當前網站其他人做的一些模板,修改了一些Bug。目前尚不支援手機版的(手機版樣式可能不對)建議用Chorme、Firefox、IE9+等進階瀏覽器開啟。祝你表白成功!你有多久沒有心動過?有多久沒有對一個男/女孩說“我愛你”?有多久沒有因為愛情哭過、痛過、崩潰過?如果你的答案是“NO”,那你的愛情沉睡得太久太久……程式遠表白網,幫你找回愛的感覺。
Time of Update: 2016-08-08
習慣了使用php跟mysql組合,現在接到項目需要調用客戶線下的系統軟體的資料,具瞭解,這個軟體的資料庫是用sqlserver資料庫也就是常說的mssql資料庫了。那麼我現在需要用PHP串連sqlserver資料庫,然後根據條件查詢我需要的資料。怎麼辦呢?用PHP原生來寫的話,肯定比較麻煩,相比之下一直以來使用的Thinkphp架構就提供了sqlserver資料庫驅動了,打算用這個來調用資料。1、首先跟客戶拿到了遠端資料庫的串連地址,使用者名稱,密碼,資料庫名稱,連接埠(值得一說的是sqlser
Time of Update: 2016-08-08
重新認識unicode和utf8編碼直到今天,準確的說是剛才,我才知道UTF-8編碼和Unicode編碼是不一樣的,是有區別的囧他們之間是有一定的聯絡的,看看他們的卻別:UTF-8的長度是不一定的,有可能是1、2、3位元組Unicode長度一定,2個位元組(USC-2)UTF-8可以和Unicode互相轉換unicode和utf8的關係Unicode(16進位)UTF-8(二進位)0000 - 007F0xxxxxxx0080 - 07FF110xxxxx 10xxxxxx0800 -
Time of Update: 2016-08-08
調用string exec ( string $command [, array &$output [, int &$return_var ]] )函數執行命令D:/xampp/htdocs/programC/R/R-3.0.3/bin/i386/R.exe --vanilla out.txt R程式安裝路徑(絕對路徑) r檔案路徑
Time of Update: 2016-08-08
$arr[$j]){ $temp = $arr[$i]; $arr[$i] = $arr[$j]; $arr[$j] = $temp; } } } return $arr;}/** * 選擇排序排序selectsort 關鍵是找到最小數組的下標 *///$arr = array(100,2,4,5,6,1,7,3); //array(1
Time of Update: 2016-08-08
1、編寫一個函數將1,2,3,4,5,6隨機放到一個數組,3不能在第三的位置,5和6不能挨著。function sort_test($array){ while(true) { shuffle($array); $temp = array_flip($array); if ($array[2] != 3 && 1 != abs($temp[5] - $temp[6])) { return $array; }
Time of Update: 2016-08-08
計劃:簡單用過,看書全面瞭解下。1、《實戰nginx:取代apache的高效能Web伺服器》內容:安裝、配置和最佳化、PHP FastCGI、JSP、反向 Proxy、負載平衡、Rewrite、緩衝、模組介紹按順序過一遍,重點看反向 Proxy、負載平衡、rewrite、緩衝和模組介紹。2、《深入理解 Nginx:模組開發與架構解析 / 陶輝著 .
Time of Update: 2016-08-08
1. 啟動 Nginx /usr/local/nginx/sbin/nginxpoechant@ubuntu:sudo ./sbin/nginx2. 停止 Nginxpoechant@ubuntu:sudo ./sbin/nginx -s stoppoechant@ubuntu:sudo ./sbin/nginx -s quit-s都是採用向 Nginx 發送訊號的方式。3. Nginx 重載配置poechant@ubuntu:sudo ./sbin/nginx -s
Time of Update: 2016-08-08
array (array("width" => 180, "height"=> 180, "path"=>"ios8", "name"=>"Icon-180.png"),array("width" => 120, "height"=> 120, "path"=>"ios8", "name"=>"Icon-120.png"),array("width" => 152, "height"=> 152, "path"=>"ios8",
Time of Update: 2016-08-08
為了處理方便,我利用 fgets() 定義了一個函數,可將檔案內容讀入到一個數組,檔案第 i 行對應數組第 i 個元素(index 是 i-1)。下面是原始碼function file2array($filename){ // read a file into an array // each element of the array is a line of file // also use explode("\r\n",