擓€銆丸畨灁呴综合缃?
銆€銆€1銆䷷笅枞絇HP鄄刋デバッグ铓╁睍锛倀刺繍鍧€锛歨ttp://xdebug.org/
銆€銆€2銆丸湪Linux涓嬬紪璇戝畨瑁匵Debug
寮kuang敤
tar -xzf xdebug-2.0.0RC3.gz
cd xdebug-2.0.0RC3
/usr/local/php/bin/phpize
./ configure --enable-xdebug
cp modules/xdebug.so /usr/local/php/lib/php/extensions/no-debug-non-zts-20020429/
銆€銆€娉fine/usr/local/ php/lib/php/extensions/no-debug-non-zts-20020429 /纴鍙相互鍦▃end_extension_ts涓嚜琛屾篹歺debug.so铓€鍦ㄤ綅缃€?
寮开椤
vi /usr/local/php/lib/php.ini
€ php.ini php.ini php.ini嗗浠g爜
浠g爜濡备笅: [Xdebug] zend_extension_ts="/usr /local/php/lib/php/extensions/no-debug-non-zts-20020429/xdebug.so"
xdebug.profiler_enable=on
xdebug.trace_output_dir="/tmp/xdebug"
xdebug.profiler_output_dir="/tmp /xdebug"
xdebug.profiler_output_name="script"
寮kuang敤
mkdir -p /tmp/xdebug
chmod 755 + €抆€涓嬭灌漑プレート潃锛樨ttp://sourceforge.net/projects/wincachegrind /
銆€銆€浜屻€丸垎鏋揯副型狋?
銆€銆€1銆佽闂綘鄄勭刺繍绔笙纴灏四椤典笂钖勭閾値鴴飣卒業the鍑犻亶锛筹Debug鍦?tmp/xdebug鐩綍颢熸帚浠ヤ笅鏂囦フアン锛? USR_LOCAL_APACHE_HTDOCS_APP_CHECKNUM_CHKNUM_PHP_CACHEGRIND.out
銆銆銆銆銆 € php_cachegrind.out
銆 € € 銆 € usr_local_apache_htdocs_app_play_php_cachegrind .out 銆 銆 銆 銆 銆 銆ER_MEMBER_PHP_CACHEGRIND.OUT
€ € € USR_Local_APACHE_HTDOCS_TAG_PHP_CACHEGRIND.OUT
銆 銆 銆 銆 銆 銆_top_php_c achegrind.out
WinCacheGrind.婸HP绋嫔簭铓цの場合€2.00铆€Key 楥琄鄄勬椂邂综合渶闀匡fine
銆€銆€/usr/local/apache/htdocs/tag/tags.php銆€銆€銆€銆€銆€銆€Key楁椂840ms
銆€銆€涓夈€丸垎鏋愮粨鏋滐 罰金
銆€銆€1銆?usr/local/apache/htdocs/tag/tags.php
銆€銆€(1)Key filter_tags filter_tags?usr/local/apache/htdocs/tag/tags.php鄄狭158琛粋fine
銆€€$tags .= filter_tags($videos[$i ]['tags'])." ";
€ include /misc.php捛実etForbiddenTags鍑鍑暟Ju琚玣ilter_tags鍑鍟暋璋卂敤所?1娆★纴filter_tags鍑必須暟Key楥构鄄勬椂邂飿枑漁濆ぇ澶氭暟锲爂etForbiddenTags鑍マスタード铟€镊欬€俫etForbiddenTags鍑獑隟镄嫴倹磹涓嬶狠
澶嶅埗浠g爜
浠g爜濡备笅:
function getForbiddenTags()
{
$tagsPath=TEMPLATE_FILE_PATH."tags/forbidden_tags.txt";
if(file_exists($tagsPath))
{ $fp = fopen($tagsPath, "り」 ); $arrconf = 配列 (); if ($ fp) {
while (!feof($fp))
$line = fgets($fp, 1024); );
$rows = 爆発("#", $line );
$coumns = 爆発("", トリム($rows[0])); ))
{
$arrconf[trim($coumns[0] ])] = トリム($coumns[1])
}
}
}
return $arrconf
}
;
(4)瀵筭etForbiddenTags鍑は絶対に注意してください鍒嗘瀽锛屽叾涓殑PHP鍑隟trim搚皟鐢ㄤ简16827娆°€?BR>銆€銆€
(5) r /local/apache/template/tags/forbidden_tags.txt参囦Huanjuan纴鏂囨湰鏁版偁搴涶殑鏁堢堼涓嶉珮銆?BR>銆€銆€阃愯璇氲彇鍑必暟fgets銆䷷相互鍙婂幓闄ゅ瓧绗︿カバー涓ヨアクト鄄勭┖锏マスタードキー呮寚瀹氱殑祛楃镄勫嚱鏁皌リム鍦ㄩ珮琐琻熻涓嬬殑鏁勢巼巼庯纴鍙 相互西安嬭瘯 fopen銆丫銆乫scanf涔嬬 锄勬枃浠不活性鍙栧皱鏁help纴瀵規制瘮涓€涓娨€?/P>
http://www.bkjia.com/PHPjc/323508.html
www.bkjia.comtruehttp://www.bkjia.com/PHPjc/323508.html技術記事涓€銆丸畕灁呴综合缃?1抆佷笅枞絇HP鄄戋Debug铓╁睍锛倀刺繍駧€锛歨ttp://xdebug.org/ 2銆丸湪Linux涓嬬紪璇戝畨瑁匵Debug 宮空椤tar -xzf xdebug-2.0.0RC3.gz cd xdebug-2.0.0RC3 /usr/local/php/...