Time of Update: 2017-01-13
ecshop經常出現報錯$data 未定義。導致整站致命錯誤!經過分析,,導致檔案shop_config.php寫入失敗。資料大小為0。從而影響整站不能訪問!這種錯誤是很致命的!解決辦法:開啟lib_base.php 尋找include_once($cache_file_path);在其後加入一行代碼$data = !empty($data)?$data:false; 動態 的意思是 在讀取 配置快取檔案失敗的情況下 程式會直接讀取資料庫記錄 並 重建 配置快取檔案。 這樣就解決了
Time of Update: 2017-01-13
在一次例行檢查日誌的時候,發現Nginx日誌中出現了大量的PHP串連Memcached逾時的報錯資訊,如下:PHP Warning: Memcache::connect(): Can't connect to 127.0.0.1:11211, Connection timed out (110) in ...連上伺服器檢查Memcached進程運行正常,然後我用一段測試代碼檢查Memcached是否能夠正常串連,結果也很正常。於是又仔細分析日誌,發現那段報錯資訊是間隔出現的,說明是有一定幾率的。
Time of Update: 2017-01-13
htmlentities函數作用在漢字變數中的時候會出現亂碼 代碼如下複製代碼 $resultsText = str_replace("[QUERY]", htmlentities($query), $resultsText); 正確的做法是改變htmlentities的預設參數htmlentities($query,ENT_COMPAT,'UTF-8') 代碼如下複製代碼 <?php
Time of Update: 2017-01-13
問題解析出來的資料不完整,有為空白的欄位網上查了下說是在php5.2.8 中存在bug解決辦法是使用自訂函數 代碼如下複製代碼 function __fgetcsv(& $handle, $length = null, $d = ',', $e = '"') { $d = preg_quote($d); $e = preg_quote($e); &
Time of Update: 2017-01-13
錯誤提示提示資訊:Warning: Failed to write session data (files).Please verify that the current setting ofsession.save_path is correct () in Unknown on line 0解決辦法 代碼如下複製代碼 session.save_path = "D:/phprun/tmp" 這個為自訂檔案夾
Time of Update: 2017-01-13
經實驗發現fread函數單次最大能夠讀取的位元組數是有限制的,僅為8192個位元組,即8KB,對於超過這個大小的檔案,如果要完整讀取,則需要迴圈讀取直至檔案結尾。綜合以上做了些改正,以下代碼是休整之後的代碼,經測試問題解決。 代碼如下複製代碼 function download($file_url,$new_name=''){ if(!isset($file_url)||trim($file_url)==''){ return
Time of Update: 2017-01-13
給web伺服器增加其它連接埠執行個體[apache+php教程]/* 找到你的apache安裝目錄,找到httpd.conf檔案, 搜尋#listen這一句,在下面增加 代碼如下複製代碼 listen 800 listen 801 listen 802 這裡是測試,你可以根據你的需要增加不同的監聽連接埠,好了apache
Time of Update: 2017-01-13
本文是採用源碼編譯方式安裝Gearmand 和 PHP Gearman,完成安裝Gearman當前最新版本1.1.2。你也可以採取傻瓜式一鍵安裝,命令如下: 代碼如下複製代碼 yum install gearmandpecl install gearman 這樣安裝的方式是一鍵安裝完成,關鍵是版本不是最新的。本文接下來主要講解源碼編譯安裝最新版 gearmand 1.1.2 - A distributed job system。
Time of Update: 2017-01-13
如果在LINUX系統上需要使用PHP串連Microsoft SQL Server 2005資料庫,我們常見的串連資料庫方式是使用ODBC方式串連. FreeTDS為Linux系統提供了TDS協議的開源用戶端。由於MSSQL和Sybase使用的恰是TDS協議,所以在Linux中可以用FreeTDS串連MSSQL,下面簡紹使用php的db-lib串連Microsoft SQL Server 2005資料庫. LINUX作業系統: centOS6.3
Time of Update: 2017-01-13
這種表單自動完成功能,像百度,google,淘寶他們的搜尋功能都有,在使用者輸入一部要的內容時會根據條件顯示相關內容。<script>;(function($){/* plugin */$.fn.autocomplete=function(o){ if(o.ajax) o.ajax=$.extend({ url:'', datatype:'json', async:true }, o.ajax||{});
Time of Update: 2017-01-13
$title.='管理記錄';$content.='<ul class="clist">';$page=(isset($_GET['page']) && intval($_GET['page'])>0)?intval($_GET['page']):1;$q_aop=sprintf('select a.*, b.name, b.photo from %s as a, %s as b where a.aid=b.id order by
Time of Update: 2017-01-13
<?php/////////////////////////////////////////////////////////////////////////////// 迷你同學錄 (http://www.piscdong.com/?m=mini_class)//// (c)PiscDong studio (http://www.piscdong.com/)//// 程式完全免費,請保留這段代碼。// 請勿出售本程式或其修改版,請勿利用本程式或其修改版進行任何商務工作。//////////
Time of Update: 2017-01-13
function get_content($url){ if(!strpos($url, '://')) return 'Invalid URI'; $content = ''; if(ini_get('allow_url_fopen')) { $content = file_get_contents($url); } elseif(function_exists('curl_init'))
Time of Update: 2017-01-13
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><?php$lianjie = mysql_connect("localhost","root","xiaolie") or die("串連失敗");mysql_query("set names
Time of Update: 2017-01-13
php+ajax 仿google 下拉框代碼一,這裡php代碼<?phpheader('Content-Type:text/html;charset=utf-8');require('../../admin/include/db_conf.php');if($_POST['add']){ $keyword = trim($_POST['keyword']);
Time of Update: 2017-01-13
(1) 使用“<?”和“?>”來包含PHP編寫的WML程式行,格式為:<?……(程式行);?>(2)
Time of Update: 2017-01-13
if($_FILES['image']['size']){ if($_FILES['image']['type'] == "image/pjpeg"){ $im =
Time of Update: 2017-01-13
<?php// $parent is the parent of the children we want to see// $level is increased when we go deeper into the tree,// used to display a nice indented treefunction display_children($parent, $level) { &
Time of Update: 2017-01-13
取得當前檔案的路徑今天一般用下面二個函數了。getcwd() 函數getcwd -取得當前工作目錄描述 字串getcwd (無效) 擷取當前的工作目錄。傳回值 返回當前工作目錄上的成功,或FALSE的失敗。在某些Unix的變種, getcwd ( )將返回FALSE ,如果任何一個父目錄沒有可讀或搜尋模式設定,即使在目前的目錄沒有。見搭配chmod ( )以擷取更多資訊的方式和許可權。執行個體例如# 1 getcwd ( )的例子dirname(__FILE__)先行編譯和宏定義,預定義常量,_
Time of Update: 2017-01-13
下面來看一篇關於linux系統nginx php-fpm安裝php memcache擴充教程,當然有不少辦法可以安裝memcache的外掛程式不過如果你使用了php-fpm 和nginx驅動php採用那些sudo apt-get install php5-memcache可能就不好用了。說說如果你把php手動安裝在特別目錄的情況下如何配置memcache php調用吧。上下文參考我寫的php-fpm安裝那篇部落格吧。 代碼如下複製代碼 cd