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
favicon.ico介紹favicon.ico是個什麼東西呢,也許見得太多都習以為常了(我就是這樣,直到寫這篇文章之前才知道),看看維基百科的解釋:Favicon是favorites icon的縮寫,亦被稱為website icon(網頁表徵圖)、page icon(頁面表徵圖)或urlicon(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
Mobile_Detect 是一個輕量級的開源行動裝置(手機)檢測的 PHP Class,它使用 User-Agent 中的字串,並結合 HTTP Header,來檢測行動裝置環境。這個裝置檢測的 PHP 類庫最強大的地方是,它有一個非常完整的庫,可以檢測出所用的裝置類型(包括操作類型,以及手機品牌等都能檢測)和瀏覽器的詳細資料。http://mobiledetect.net///使用執行個體 include 'Mobile_Detect.php';$detect = new
Time of Update: 2016-08-08
代碼如下:date_default_timezone_set('PRC'); //預設時區 echo "今天:",date("Y-m-d",time()),""; echo "今天:",date("Y-m-d",strtotime("18 june 2008")),""; echo "昨天:",date("Y-m-d",strtotime("-1 day")), ""; echo "明天:",date("Y-m-d",strtotime("+1 day")
Time of Update: 2016-08-08
我們前面說過在類裡面聲明“--”開始的方法名的方法(PHP給我們提供的),都是在某一時刻不同情況下自動調用執行的方法,“__toString()”方法也是一樣自動被調用的,是在直接輸出對象引用時自動調用的, 前面我們講過對象引用是一個指標,比如說:“$p=new Person()“中,$p就是一個引用,我們不能使用echo 直接輸出$p, 這樣會輸出”Catchable fatal error: Object of class Person could not be converted to
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
1、刪除字串的第一個字元:$string='';foreach($arrayas$key => $value){ $string .= ",$value";}$string = substr($string,1);2、定義頁面編碼格式:meta http-equiv=content-type content="text/html;
Time of Update: 2016-08-08
1、 安裝建議下載openresty ,包比較全,安裝簡單方便; 下載地址 http://openresty.org/download/ngx_openresty-1.7.10.1.tar.gz2、編譯安裝tar xzvf ngx_openresty-1.7.10.1.tar.gzcd ngx_openresty-1.7.10.1./configure --with-luajitmakemake install3、修改nginx config -
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
nginx 反向 Proxy及動靜分離http { include mime types; default_type application octet-stream; tcp_nopush on; keepalive_timeout 65;upstream test{ shttp { include mime.types; default_type application/octet-stream; #tcp_nopush on;
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
修改nginx/conf/nginx.conf,修改完後如下:user www www;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;events { worker_connections 1024;}http { include
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
Time of Update: 2016-08-08
添加源檔案首先在src/core/目錄下添加兩個檔案,分別是my_debug.h和my_debug.c。#ifndef MY_DEBUG_LENKY_H#define MY_DEBUG_LENKY_H#include void enable_my_debug(void) __attribute__ ((no_instrument_function));void disable_my_debug(void) __attribute__ ((no_instrument_function));int
Time of Update: 2016-08-08
一、修改httpd.conf開啟appserv的安裝目錄,找到httpd.conf檔案,分別去掉下面兩行文字前面的#號。 [plain] view plaincopy#LoadModule vhost_alias_module modules/mod_vhost_alias.so 去掉#意思是啟用apache的虛擬機器主機功能。 [plain] view plaincopy#Include conf/extra/httpd-vhosts.conf 去掉這一行的#意思是從conf/extra/