Time of Update: 2016-08-08
一、修改Apache連接埠 1、在介面中選Apache,彈出隱藏菜單選項,開啟設定檔httpd.conf;2、找到 Listen 80; 3、將 80 改成 8080(當然自己也可以設定別的不使用的連接埠);4、儲存,待重啟Wamp服務後即可。 二、修改Wamp開啟預設頁 Localhost 和 phpMyadmin 的連接埠 1、開啟wamp目錄下wampmanager.tpl檔案2、找到Parameters: "http://localhost/"; Glyph: 5Parameters:
Time of Update: 2016-08-08
the boolean FALSE itselfthe integer 0 (zero)the float 0.0 (zero)the empty string, and the string "0"an array with zero elementsan object with zero member variables (PHP 4 only)the special type NULL (including unset variables)SimpleXML objects
Time of Update: 2016-08-08
1.在/basic/config/console.php和/basic/config/web.php裡,配置組件,這裡只貼出console.php裡的代碼 : 'basic-console', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log', 'gii'], 'controllerNamespace' =>
Time of Update: 2016-08-08
lsof工具檔案描述符是一個簡單的整數,用以標明每一個被進程所開啟的檔案和socket。第一個開啟的檔案是0,第二個是1,依此類推。Linux作業系統通常給每個進程能開啟的檔案數量強加一個限制,Linux通常有一個系統級1024的限制。 隨著並發的增大,原有系統預設的1024個檔案描述符肯定會不夠用,時間越長,系統可能會報如下錯誤:open files limits…..查看nginx進程所佔用的檔案描述符,可以執行命令:lsof | grep nginx部分結果nginx 6845
Time of Update: 2016-08-08
五、ajax快速入門ajax代碼:Php程式:六、發送資料Ajax的get請求時,要發送的資料需要附加到url的後面Ajax的post請求時,要發送的資料需要放到send方法的參數中Ajax代碼:Php代碼:故意將請求的url寫錯,我們發現,即使用請求了一個不存在的url,那麼ajax對象的狀態代碼最終也會等於4,並且執行相應的語句,而我們希望如果請求的是一個錯誤頁面,那麼就不應該執行相應的語句做一些相應的修改利用ajax計算兩個數的和七、解決緩衝問題以上的問題:將php中的加法改成減法如果用之
Time of Update: 2016-08-08
PHP 註解到目前為止,PHP的反射特性中是不支援註解Annotation的,但是可以支援基本的文檔注釋內容的擷取 ReflectionMethod::getDocComment() - 從5.1.0開始 。PHP的反射其實已經挺強大的了,只要再進一步,解析文檔注釋中的相關註解內容即可。AppServer.io 提供了一個lang庫,實現了對註解的支援。其中還運用了PHP的Tokenizer特性來解析註解代碼,具體原理不詳述,有興趣自行閱讀代碼。
Time of Update: 2016-08-08
一:清除字串左右兩邊的空格和字元, 函數 trim()$str = " hello,word ";echo$str."";echo trim($str)."";$str = "@黎明hello,word@";echo ltrim($str)."";echo rtrim($str);結果如下,ltrim()清除左側的空格和字元,rtrim()清除右側的空格和字元 二、逸出字元串的函數 / addcslashes(str,ch)和stripcslashes(str);$str =
Time of Update: 2016-08-08
為了支援國產,本人使用了onethink建立了一個自己的網站( 模板世界:www.templatesy.com
Time of Update: 2016-08-08
交接模式之類比毛筆(1) 實作類別介面interface Color{public function bepaint($penType,$name);}(2) 具體實現顏色類class Red implements Color{public function bepaint($penType, $name) {echo $penType.'紅色的'.$name;}}class Green implements Color{public function
Time of Update: 2016-08-08
1.安裝環境系統內容:centos6.3_x64軟體版本:nginx-1.4.2.tar.gz nginx_tcp_proxy_module-master.zip2.軟體安裝cd /root/wget http://nchc.dl.sourceforge.net/project/pcre/pcre/8.12/pcre-8.12.tar.gztar zxvf pcre-8.12.tar.gzcd pcre-8.12/./configuremake && make installcd
Time of Update: 2016-08-08
PHP中獎數組轉為xml的需求是常見的,而且實現方法也有很多種,百度找了一下各種實現方法,但是基本是借組一些組件啥的。我就自己寫了一個字串拼組的方法,支援多維陣列。僅供參考,不足之處敬請不吝賜教!/*** 將數群組轉換為xml* @param array $data 要轉換的數組* @param bool $root 是否要根節點* @return string xml字串* @author Dragondean* @url
Time of Update: 2016-08-08
四.格式化字串函數 number_format()$str = "123445677";$strl = number_format($str);$str2 = number_format($str,2);$str3 = number_format($str,2,",",'.');echo$str."";echo$strl."";echo$str2."";echo$str3.""; 結果如下所示,number_format(str)表示在千分位上加,隔開。number_format(str,2)
Time of Update: 2016-08-08
閱讀源碼的最好方式就是跟蹤調試代碼,這裡介紹了如何利用GDB調試nginx的配置和步驟。修改設定檔修改nginx.conf:#user nobody;master_process off;daemon off;daemon off;表示關閉守護進程模式,這樣就免除了用GDB跟蹤fork出的子進程了。如果預設啟用守護進程,標準輸出是被關閉的。因此關閉守護進程模式能夠利用printf方便查看變數的值。 master_process
Time of Update: 2016-08-08
工作過程中需要編譯php擴充的dll格式檔案 , 經過1天的折騰,終於編譯出來了,下面以編譯php5.3.28 下runkit擴充為例 , 官方的windows環境下php編譯過程參考下面這兩篇文章:https://wiki.php.net/internals/windows/stepbystepbuildhttp://blog.csdn.net/mycwq/article/details/10165955php5.3.28 , runkit編譯的過程基本就是跟文檔一致 ,
Time of Update: 2016-08-08
一、 緩衝原理:IE:將資源檔儲存至本地Smarty:將緩衝儲存到伺服器編譯 二、 為什麼使用緩衝技術1、提升網站訪問速度2、減輕web伺服器壓力3、減輕資料庫伺服器壓力三、 設定緩衝1、在smarty中,設定緩衝主要通過以下幾行代碼:l $smarty->setCacheDir($cache_dir)設定緩衝目錄將來產生的快取檔案會自動放在這個目錄下l
Time of Update: 2016-08-08
進入設定檔:vi /usr/local/webserver/nginx/conf/nginx.confupstream www.linux.com{ server 192.168.1.204:80; } proxy_cache_path /data0/htdocs/www/aaa levels=1:2 keys_zone=aaa:20m max_size=1g; server { listen 80;
Time of Update: 2016-08-08
一個頁面中,有些資料緩衝,有些資料不緩衝,就是局部緩衝l $smarty->assign(“var”, “value”, true)第三個參數:表示是否不緩衝l {$var nocache=true}在模板變數量後使用nocache參數l
Time of Update: 2016-08-08
php //查詢多條記錄,返回二維數組 $result = M("admin")->select(); $result = M("admin")->where("id>2")->select(); $result = M("admin")->where("id>2")->order("id desc")->limit("0,5")->field("id,username,psssword")->select(); $result =
Time of Update: 2016-08-08
1,預設安裝nginxsudo apt-get install nginx如果找不到就sudo apt-get update一下2,進入nginx配置目錄cd /etc/nginx3,建立自己項目的nginx設定檔cd nginx.dtouch aaa.conf4,配置自己項目的代理upstream imdou8{ server localhost:8000;}server{ listen 80; server_name 104.128.**.**; location / {
Time of Update: 2016-08-08
一 簡介web程式工作原理圖:傳統的web程式工作原理圖:Ajax工作原理圖:1、 關於Ajaxl Asynchronous 非同步l JavaScriptl Andl XMLAjax就是利用javascript與xml和伺服器互動資料的一種技術Xml:Json:2、 發展曆程l 1998年 誕生l 2005年 流行3、 運行平台l Google Chromel Mozillal Firefoxl Internet Explorerl