Time of Update: 2016-07-29
安裝dede UTF_8時報出了一個致命錯誤和警告,最後不能顯示網站後台和首頁了。報錯如下:登陸首頁顯示:Fatal error: Call to undefined function ParCv() in /include/dedesql.class.php on line 489登陸後台顯示:Deprecated: Function ereg_replace() is deprecated in /dede/config.php on line 2Fatalerror: Call to
Time of Update: 2016-07-29
類的自動載入在外面的頁面中,並不需要去引入類檔案,但程式會在需要一個類的時候自動去“動態載入”該類。建立一個對象的時候new直接使用一個類名(操作靜態屬性與方法)使用__autoload魔術函數 當出現兩種情況時候,就會調用該函數,該函數需要我們預先定義,在其中寫好載入類檔案的通用語句function__autoload($name){require'./lib/'.$name.'.class.php';}使用spl_autoload_register()
Time of Update: 2016-07-29
隨意準備一個資料表CREATETABLE`entry` ( `id`INT(11) NOTNULL AUTO_INCREMENT, `value`VARCHAR(12) NULLDEFAULTNULL, PRIMARYKEY (`id`))COLLATE='utf8_general_ci'ENGINE=InnoDBAUTO_INCREMENT=12;配置Yii資料庫連結首先要知道ActiveRecord是利用PDO_MySQ來實現的,所以要確認自己的這個外掛程式好用。
Time of Update: 2016-07-29
https://github.com/NetEase/pomelo/wiki/pomelo%E5%BF%AB%E9%80%9F%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97點擊開啟連結https://github.com/NetEase/pomelo/wiki/tutorial1--%E5%88%86%E5%B8%83%E5%BC%8F%E8%81%8A%E5%A4%A9https://github.com/NetEase/pomelo/wiki/Home-in-Chi
Time of Update: 2016-07-29
今天由於工作的需求,需要擷取html標籤的屬性值,立即想到了Regex,標籤如下: 需要擷取標籤的cx、cy的屬性值,想了一會寫出了一個:$circle是上面的circle標籤的內容preg_match_all('/]*?cx\s*=\s*(\'|\")(.*?)\\1[^>]*?cy\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i', $circle,
Time of Update: 2016-07-29
這篇文章主要介紹瞭解決php的“It is not safe to rely on the system’s timezone settings”問題的方法,需要的朋友可以參考下如果使用PHP5.3以上版本時,如果沒有正確的配置php.ini就會出現PHP日期函數的錯誤。以前很多舊的PHP編程教程沒有說到這個問題,所以不少讀者會覺得困惑,下面筆者為大家講述解決這個問題的三種方法。"PHP Warning:date() [function.date]: It is not safe to
Time of Update: 2016-07-29
最近開發登入系統,由於涉及到密碼相關,請求需要以https方式,而線上大前端的nginx有認證的數位憑證,因此線上可以解析我們的https請求,並成功返回,但是在測試環境中,直接佈建網域名host,返回404。 於是乎,要自己配置https相關內容。 首先,產生認證相關檔案,從網上查到資料如下: # 產生一個RSA密鑰 $ openssl genrsa -des3 -out my.key 1024 #
Time of Update: 2016-07-29
php項目中,為了訪問連結的友好性及SEO最佳化,我們經常需要為訪問頁面配置一個短連結,並把index.php去掉。 php所用的web伺服器通常為:nginx或者apache。下面分別說一下兩種伺服器的不同配置方法NGINX 配置: 1、開啟nginx設定檔:/usr/local/nginx/conf/nginx.conf 2、修改檔案,有兩種文法 A:location / { try_files $uri$uri/
Time of Update: 2016-07-29
下班了,今天總結一下如何在Windows作業系統中安裝、啟動和卸載memcached: 1、下載相關軟體: 下載地址:http://download.csdn.net/download/wangshuxuncom/8249501; 2、解壓擷取到的壓縮檔,將得到一個名為“memcached-1.2.6-win32-bin”的檔案夾,將該檔案夾拷貝到自認為適當的位置(比如拷貝到C盤根目錄); 3、通過cmd命令進入Windows的命令列模式,
Time of Update: 2016-07-29
背景行動裝置經常會發生使用者發送的內容中包含emoji表情,未經處理,在顯示時就是亂碼。解決方案1.資料庫支援:將Mysql的編碼從utf8轉換成utf8mb4。 2.匹配出內容中的emoji表情做過濾或替換/** * 表情轉換 更新到ios9.2涵蓋編碼範圍 * @param $str * @return mixed */public static function emoji_to_html($str) { $regex =
Time of Update: 2016-07-29
安裝伺服器組件sudo apt-get update //獲得最近的軟體包的列表sudo apt-get install nginx //安裝Nginx伺服器sudo apt-get install php5-fpm//安裝php5sudo apt-get install php5-cli//安裝php5在命令列啟動並執行介面sudo apt-get install php5-mcrypt//安裝php5加密拓展庫sudo apt-get install
Time of Update: 2016-07-29
從今天起每天收集php面試資料,為了找個好工作,更為了技術提升。1. 簡述POST 和GET傳輸的最大容量分別是多少? Get受url長度限制,與瀏覽器和作業系統有關,例如IE對URL長度的限制是2083位元組(2K+35) Post的話限制取決於伺服器設定。 2.禁用COOKIE 後 SEESION 還能用嗎?
Time of Update: 2016-07-29
自用的,不喜勿噴。自己安裝成功了。內容有摘自網路。1、安裝必備工具:$ yum -y install gcc gcc-c++ autoconf automake$ yum -y install zlib zlib-devel openssl openssl-devel pcre-devel 說明: pcre: 用來作地址修正的功能。zlib:nginx 的gzip模組,傳輸資料打包,省流量(但消耗資源)。openssl:提供ssl加密協議。 二、Nginx編譯安裝:1、下載Nginx:http:
Time of Update: 2016-07-29
有兩種方案一、url(r'^sitemap\.xml/$', TemplateView.as_view(template_name='sitemap.xml', c/xml')),urls.py中加入新的urlpattern,用TemplateView去展示二、 直接交給nginx來處理,在nginx的conf檔案中加入要處理的static URL和路徑location
Time of Update: 2016-07-29
設計模式簡單說應對某類問題而設計的解決方式原廠模式:應對需求建立相應的對象classfactory{function__construct($name){if(file_exists('./'.$name.'.class.php')){ returnnew$name; }else{ die('not exist'); }
Time of Update: 2016-07-29
數組的結構體定義:typedefstruct ngx_array_s ngx_array_t;struct ngx_array_s { void *elts; // 指向數組儲存位置的首地址 ngx_uint_t nelts; // 當前數組中已經存放的元素個數 size_t size; // 數組中每個元素的大小 ngx_uint_t nalloc;
Time of Update: 2016-07-29
'home.php', 'Contact' => 'contact.php', 'Services' => 'services.php', 'Site Map' => 'map.php' ); public function __set($name,$value){ $this->$name = $value;
Time of Update: 2016-07-29
原地址:http://www.cnblogs.com/eoiioe/archive/2008/09/20/1294681.html.tar 解包:tar xvf FileName.tar打包:tar cvf FileName.tar DirName(註:tar是打包,不是壓縮!)———————————————.gz解壓1:gunzip FileName.gz解壓2:gzip -d FileName.gz壓縮:gzip FileName.tar.gz 和 .tgz解壓:tar zxvf
Time of Update: 2016-07-29
淺複製:只是複製對象中的非對象非資源資料,即對象中屬性儲存區的是物件類型,則會出現複製不完全classB{public$val = 10;}classA{public$val = 20; public$b; publicfunction__construct(){$this->b = new B(); }}$obj_a = new A();$obj_b = clone$obj_a;$obj_a->val = 30;$obj_a->b->val =
Time of Update: 2016-07-29
小偷程式:把遠程網站上的資料(圖片,網頁及其他檔案)抓取到本地,處理後再顯示Regex:用於字串的模式分割 、匹配、尋找及替換操作。相關函數:int ereg ( string $pattern , string $string [, array &$regs ] )若省略參數返回的數組,找到則返回值為 True 否則 返回 False與之對應 eregi() 不區分大小寫。 string file_get_contents ( string $filename [, bool