Time of Update: 2016-07-28
決解方案: 首先將回調地址改為:“http://你的網域名稱/account/openid/qq/bind/” 然後需要開啟偽靜態設定,開啟偽靜態後頁面出現錯誤 需要在nginx配置偽靜態。 我用的是nginx 伺服器 ,下面貼出偽靜態設定檔server { listen 80; server_name 網域名稱 ; index index.html index.htm index.php; root 項目所在的目錄;
Time of Update: 2016-07-28
header('content-type:text/html;charset=utf8');$Database = new PDO('mysql:host=127.0.0.1;dbname=iweb','使用者','密碼');//執行SQL語句 鎖掉userinfo表$sql = "LOCK TABLES iwebshop_goods WRITE";//表的WRITE鎖定,阻塞其他所有mysql查詢進程$Database->exec($sql);//執行更新或寫入操作$sql =
Time of Update: 2016-07-28
由於我的伺服器是買的雲端服務器,因此整個是串連ssh進行配置的LNMP由於雲端服務器剛使用不久,此前一直是只安裝了centos 6.5版本的裸機,因此這次順道配置了LNMP,整個LNMP環境的安裝和LAMP環境的搭建基本一致。附本人蔘照的配置部落格:http://www.cnblogs.com/xiaoit/p/3991037.html,這篇部落格只是基礎的安裝LNMP,並測試Nginx解析php指令檔,並未對各個環節做詳細配置說明,如果想看詳細的配置,請自行百度。node.js安裝在Node.
Time of Update: 2016-07-28
1.關於array_search 和 unset原始代碼:public function appViewUnread($uid, $id) { $userNewRepyKey = Config_CacheKey::USER_QUESTION_NEW_REPLY.$uid; $userNewReply = $this->appGetUserNewReply($uid); $key = array_search($id,
Time of Update: 2016-07-28
最近在實現最土團購系統的價格排序功能,需要對$oc數組進行擴充,經過測試用下面的方法即可。核心代碼如下:php $now=time(); $oc = array( 'team_type' => 'normal', "begin_time $now}'", "end_time > '{$now}'",); $p="p2"; $pp1=""; $pp2=""; $now = time(); switch ($p) { case "p1": $pp1="team_price ; $pp2="";
Time of Update: 2016-07-28
/** * 簡單演算法 之 從一段無序的字串中取出最長的一段不重複的字串 * 時間空間複雜度 O(n) * 2016/06/18 */$str = '';$arr = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','y','z'];for($i=0;$i $str .=
Time of Update: 2016-07-28
/** * 建立父節點樹形數組 * 參數 * $ar 數組,鄰接列表方式組織的資料 * $id 數組中作為主鍵的下標或關聯鍵名 * $pid 數組中作為父鍵的下標或關聯鍵名 * 返回 多維陣列 **/function find_parent($ar, $id='id', $pid='pid') { foreach($aras$v) $t[$v[$id]] = $v; foreach ($tas$k => $item){ if( $item[$pid] ){ if( !
Time of Update: 2016-07-28
Notice: Undefined variable 這就是將警告在頁面上列印出來,雖然這是有利於暴露問題,但實現使用中會存在很多問題。 需要設定顯示錯誤層級,來解決問題。 網路上的通用解決辦法是修改php.ini的配置:解決方案: 1) error_reporting設定: 找到error_reporting = E_ALL 修改為error_reporting = E_ALL & ~E_NOTICE 2)
Time of Update: 2016-07-28
在編譯安裝php時日誌中出現下錯誤記錄: virtual memory exhausted: Cannot allocate memory在php.net上找到的解決方案,原文連結是:https: //bugs.php.net/bug.php?id=48809解決方案:將php安裝設定檔中加了引號中的配置(不包括引號)“–disable-fileinfo”').addClass('pre-numbering').hide();
Time of Update: 2016-07-28
前言:基於 Laravel 5.2 版本環境要求:PHP 5.5.9+,MySQL 5.1+ Laravel 官網地址: http://www.golaravel.com/官方學習教程地址: http://www.golaravel.com/post/2016-ban-laravel-xi-lie-ru-men-jiao-cheng-yi/一、安裝composer 如果還未安裝 composer的同學
Time of Update: 2016-07-28
mysql_connect()串連資料庫mysql_select_db選擇資料庫mysql_fetch_assoc()擷取結果集mysql_query()執行sql語句執行個體如下: $con=@mysql_connect('localhost','root','root');//串連資料庫 mysql_select_db('test',$con);//選擇資料庫 $userInfo=mysql_query("select * from
Time of Update: 2016-07-29
由於自學,很多常識都不知道、都不理解……問題:如果是.html的尾碼不會顯示php的列印,把尾碼更改為.php後恢複正常(前提:伺服器搭建好)htmllang="en">head>metacharset="utf-8">title>測試title>head>body>h1>helloh1>$a=array("Dog","Cat","Horse"); print_r($a); ?>body>html>原因:靜態網頁主要有html、CSS、JavaScript
Time of Update: 2016-07-29
/*MYSQL的交易處理主要有兩種方法。1、用begin,rollback,commit來實現begin 開始一個事務rollback 交易回復commit 事務確認2、直接用set來改變mysql的自動認可模式MYSQL預設是自動認可的,也就是你提交一個QUERY,它就直接執行!我們可以通過set autocommit=0 禁止自動認可set autocommit=1 開啟自動認可來實現事務的處理。當你用 set autocommit=0
Time of Update: 2016-07-28
// 過濾惡意IPfunction deny_bad_ip($kmLoginIP){$bad_ip_arr = array();$bad_ip_sql = "select ip,count(ip) num from anlene_join_user group by ip having num>100"; // 擷取惡意ip$bad_ip_rs = mysql_query($bad_ip_sql);while($bad_ip_row = mysql_fetch_assoc($bad_ip_rs)
Time of Update: 2016-07-28
namespace Illuminate\Events;use Exception;use ReflectionClass;use Illuminate\Support\Str;use Illuminate\Container\Container;use Illuminate\Contracts\Broadcasting\ShouldBroadcast;use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;use Illuminate\
Time of Update: 2016-07-28
有三大類:1、基礎資料型別 (Elementary Data Type):整數型(integer),可以是正、負整數十進位,八進位,十六進位;浮點型(float),字串型(string),布爾類型(boolean),2、複合資料型別:數組(array)對象(object)3、特殊資料類型:null()資源類型(resource)註:1>在下列情況下一個變數被認為是 NULL:被賦值為 NULL。尚未被賦值。被 unset()。
Time of Update: 2016-07-28
Nginx中的stub_status模組主要用於查看Nginx的一些狀態資訊. 本模組預設是不會編譯進Nginx的,如果你要使用該模組,則要在編譯安裝Nginx時指定:./configure –with-http_stub_status_moduleJava代碼 [root@10.10.90.97 ~]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module [root@10.10.90.97 ~]#
Time of Update: 2016-07-28
nginx依賴一些軟體庫,在安裝之前請確保系統安裝了gcc、ssl、pcre和gzip等軟體,可以用rpm -q 命令查看軟體是否安裝。 [root@RedHat1 ~]# rpm -q gccgcc-4.1.2-44.el5依賴庫資訊如下:(1). gzip 模組需要 zlib 庫 ( 下載: http://www.zlib.net/ )(2). rewrite 模組需要 pcre 庫 ( 下載: http://www.pcre.org/)(3)
Time of Update: 2016-07-28
1、nginx 查看並發串連數方式有兩種,一種是在nginx.config檔案中配置 然後通過瀏覽器查看,另一種是使用命令,本人用的windows進行使用的,所以使用瀏覽器方式比較方便。location /status {stub_status on;access_log logs/status.log;auth_basic "NginxStatus"; }在server裡面加入上述代碼,然後在瀏覽器中輸入 解析:Active connections //當前 Nginx
Time of Update: 2016-07-28
1、如果能將類的方法定義成static,就盡量定義成static,它的速度會提升將近4倍。2、$row[’id’] 的速度是$row[id]的7倍。3、echo 比 print 快,並且使用echo的多重參數(譯註:指用逗號而不是句點)代替字串串連,比如echo