Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article?
PhpStormã§ã¯æ¥µãã¦ç´æçã«ãããã°ã®è¨å®ãåºæ¥ã¾ãã®ã§é£ãããã¨ã¯ããã¾ãããããããªããphp.iniã«ã¡ãã£ã¨ããè¨å®ééãããããã¾ããããã°åºæ¥ãªããã¨ã¯ãã¾ã«ãããã¹ãã¬ã¹ããã¾ããã®ã§ãã ä¸ã§ããããã¡ãªééãã¯xdebug.remote_enableãæ¸ãå¿ãããã¨ã¯ã§ãã ææ°ã®PhpStorm 7 EAPãã«ãã§è¿½å ãããDebugger Configuration Validation(ãããã¬è¨å®æ¤è¨¼)æ©è½ã使ãã¨è¨å®ã§è¶³ããªãé¨åãããã°ææãã¦ããã¾ãï¼PhpStormã¯Xdebugã¨Zend Debugger両æ¹ã®ãããã¬è¨å®æ¤è¨¼ã«å¯¾å¿ãã¦ãã¾ãã ã»Debugger Configuration Validationã®å®è¡æ¹æ³ ããã¸ã§ã¯ãã®PHPã¤ã³ã¿ããªã¿ãè¨å®ããã¨PhpStormã¯ã¤ã³ã¹ãã¼ã«ããã¦ãããããã¬ãæ¤åºãèªèã表示ãã¦ããã¾ãã
2012/5/26 追è¨ã¨ä¿®æ£ãè¡ãã¾ãã ãããããã¿ã¼ã³ã®å²ã«ãEclipse(PDT)ã§ã®è§£èª¬ãããªãã®ã§ãä»å¾å©ç¨ãã人ã®ããã«æé ãæ®ãã¦ããã 確èªããç°å¢ã¯ä»¥ä¸ã®ï¼ã¤ã ã MacOS X(Snow Leopard) + NetBeans6.9.1 + CakePHP1.3 + xdebug2.1.0ãApacheã¯MAMPã§ã¯ãªããMacPortsã§ã¤ã³ã¹ãã¼ã« MacOS X(Lion) + NetBeans7.1.2 + CakePHP1.3 + xdebug2.2.0ãApacheã¯Lionæ¨æºãPHPã¯HomeBrewã§ã¤ã³ã¹ãã¼ã« PHPã«pearãçµã¿è¾¼ã xdebugã®ã¤ã³ã¹ãã¼ã«ã«ã¯peclã³ãã³ããå©ç¨ããã®ã ããMacPortsã§ä½ãèããã«PHPãã¤ã³ã¹ãã¼ã«ããã¨ãpearããµãã¼ããããªãå½¢ã«ãªã£ã¦ããã®ã§ä»¥ä¸ã®ããã«ãã¦ãpearãçµã¿è¾¼ãã su
ããã«ã¡ã¯ãtanakaã§ããä»æ¥ã¯PhpStorm ã§ãXdebugã®ãªã¢ã¼ããããã°ç°å¢ãä½ãã«å¼ãç¶ãã¦ããããã¡ã¤ã©æ©è½ãç´¹ä»ãã¾ãã Xdebugã®ãããã¡ã¤ã©æ©è½ã¨PhpStorm Xdebugã®ãããã¡ã¤ã©æ©è½ã¨ããã®ã¯ã1ã»ãã·ã§ã³ã®éã«èªã¿è¾¼ãã PHPã¹ã¯ãªãããé¢æ°ã®å®è¡ã«ããã£ãæéãéè¨ãããã°ã¨ãã¦ä¿åããæ©è½ã§ãã PhpStorm ã®ãããã¡ã¤ã©æ©è½ã¯ããªã¢ã¼ããããã°ãããã·ã³ãã«ã§ããXdebugã§ãããã¡ã¤ã«ä¿åã®æ©è½ãæå¹ã«ãã¦ããã©ã¦ã¶ã«ã¦éçºç°å¢ã®ãµã¤ãã表示ãã¾ããããããã¨ç¹å®ã®ãã£ã¬ã¯ããªã«ãcachegrind.out.12345ããªã©ã®ãã¡ã¤ã«åã§ãã°ãä¿åããã¾ãã®ã§ãPhpStormã®ã¡ãã¥ã¼ããéãã¨ããããããã表示ãã¦ããããã¨ãããã®ã§ãã æ¬å®¶ããã°ã®æ°æ©è½ç´¹ä»ã§ã¯"Xdebug profiler integration"(
ä»æ¥ã¯ãªãã¨ããã°ããã®ãã第ä¸ä¸ä»£iPadã¯ãªãã£ããã¨ã«ãªã£ã¦ãã¿ãããªã®ã§ãæ°åãæ²ãã§ããtanakaã§ããã§ãï¼Kindle ãã¤ãã«æ¥æ¬ã«ãã£ã¦ããã¨ãããã¨ã§æ¥½ãã¿ã§ããçãç®ã¯Kindle Paperwhite 3Gã§ãã ãã¦ã話ã¯å¤ããã¾ããæåã§ãããªã¹ã¹ã¡ã®IDE PhpStormã®è©±ããã¾ããæ¥ããããªããä»ã¾ã§Xdebugã®ãªã¢ã¼ããããã°æ©è½ã使ãã¦ãã¾ããã§ãããããã¤ãã«ãã¤ãã«è¨å®ã§ããã®ã§ãã®ä½¿ãæ¹ãã¾ã¨ãã¾ããç°å¢ã¯PhpStorm 5.0 (Mac OS X 10.8.2), PHP/Apacheã¯MacPortsã§ã¤ã³ã¹ãã¼ã«ãã¦ãã¾ãã ãªã¢ã¼ããããã°ã§ä½ãã§ããï¼ å¦çãç¹å®ã®è¡ã§ä¸æããã¦ãå¤æ°ãä¸èº«ããã§ãã¯ã§ãã ä¸ã®å³ã¯ãããCakePHPã®ã³ã³ããã¼ã©ã®ä¸ã§å¦çãä¸æãã¦ãå¤æ°ã®ä¸èº«ãè¦ãæã®å³ã§ãã çãä¸ã®æ®µã§ãã³ã³ããã¼ã©ã®
PHPã®ãããã¡ã¤ã©ã¼ãXHProfããç´¹ä»ããã¦ããã å ãã¿ã¯phpspotéçºæ¥èªããã åã¯ãXdebugã¨WinCacheGrindã§ãããã¡ã¤ã«ã§ããããXHProfã ã¨ä¸åº¦è¨å®ããã°ãã©ã¦ã¶ã ãã§ãããã£ãªã³ã°ã§ããããã§ã¼ä¾¿å©ã ã¨ããããã§ãæ©éãµã¼ãã¼ï¼CentOS 5.4ï¼ã«ã¤ã³ã¹ãã¼ã«ãã¦ã¿ãã ã¤ã³ã¹ãã¼ã« å ¬å¼ããã¥ã¡ã³ã ï¼ï¼ã½ã¼ã¹ããã¦ã³ãã¼ã cd /root wget http://pecl.php.net/get/xhprof-0.9.2.tgz ï¼ï¼makeãã¦ã¤ã³ã¹ãã¼ã« tar xvfz xhprof-0.9.2.tgz cd xhprof-0.9.2/extension/ phpize ./configure make make install make test ï¼ï¼php.iniãç·¨é vi /etc/php.ini [xhprof] ex
ããâ¯â¯ã¯ãã¡ãã³ãã§ããç®ãå±ãç¯å²ã®ã³ã¼ããªã使ãæ £ããã¨ãã£ã¿ã¯æå¼·ã§ã¯ããã¾ãããä»æã®PHPéçºã¯INHOUSEãªã©ã¤ãã©ãªããã£ããããã¡ã¯ã¢ã¸ã£ã¤ã«ï¼å¤§æ¦æå³ãåãã£ã¦ãªãï¼ã ããããã¥ã¡ã³ããªããã¨ãæå³ä¸æãªè¨èãåãã¤ã¤éçºãç¶ãã¦ããã®ã§æ¬å½ã«ä¸åæ»ãã°ããã®ã«ã¨ãæã£ã¦å£ã«åºãã¦ãã¾ã£ãããããã¨ãå¤ã ããã¾ãããããã¯ããã§åé¡è§£æ±ºãææ¡ã§ããªãèªåã¯éã£ã¦ã¨ã·ï¼ã¨ããæãã§ããã PHPã5.3ã«ãªãnamespaceãå°å ¥ãããã¨ã¯ã©ã¹ã®ç´°ååãè¡ãããç®ã°ã¬ããã§å¹ççã«è¿½ãã®ã¯é常ã«å¤§å¤ã«ãªã£ã¦ãã¾ããããããªPHP大èªæµ·æ代ã®ä¸ã§çãæ®ãããã®çåæ¦ç¥ã¨ãã¦ã¯PHPç¨ã®IDEã使ãã®ãè²»ç¨å¯¾å¹æçã«ä¸çªè¯ãããã®ãªãã§ãä»è¼ãã¦ããPHPä¼æ¥ã使ã£ã¦ããIDEãããè³é«ï¼ã§ãã®ã§PHPStormãåã¯æ¼ãã¦ãã¾ãã http://www.jetbra
ä»ã PHP ã§éçºããã¨ãã« Xdebug ã¯èª°ããå½ç¶ã¤ãã£ã¦ãããï¼ï¼ ã¾ããã俺ã¯ãã®ã¾ã¾ã®ã¨ã©ã¼ã好ããªãã ãã£ã¦äººã¯ç½®ãã¦ããã¨ãã¦ããã 大ä½ã®äººã¯ãstack traceãããã¨å¬ããã¨ããvar_dump() è¦ãããã¨ãããããããã¨ã§ Xdebug ã£ã¦ã®ã¯æç¨ã ã¨ããããã§ããï¼ IDE ã®ã²ã¨ã¯ remote debugger ã¨ãã¦ã¤ãã£ã¦ãã®ããªï¼ ã§ãXdebugããããããããã ãã©ãã©ããã«ã¯ã¤ãµã足ããªãããï¼ãªãããããæ¯ã ããã¨ããããªãã¨ããããã éçºä¸ã«ã¨ã©ã¼ã ããã¨ãã¡ããã©å¾ãããããããã¶ã¤ãã¼ã®å¥³ã®åãéãããã£ã¦ç»é¢ãç®ã«å ¥ã£ãã¨ããããã°ã©ãã¼ã£ã¦ãªãã¦åã®ãªãç»é¢ãè¦ã¦ãã®ãããããªãã¦æããããã¢ããªãããï¼ï¼ ã£ã¦ãã¨ã§ãã¾ãåè«ã¯ãã®ã¸ãã«ãã¦ããã¦ãè¦ãç®ã綺éºã ã¨ããæ°ãåºãï¼ï¼ï¼ã£ã¦ãã¨ã§ãXdebug ã®åºåããã
PHPã¹ã¯ãªããã«ãã¬ã¼ã¯ãã¤ã³ããè¨å®ãã¦ãã¹ãããå®è¡ã§ããã°ä½ãã¨ä¾¿å©ã§ãã Linuxãµã¼ãã¼ã®PHPã¦ã§ããã¼ã¸ãWindowsã¯ã©ã¤ã¢ã³ããããªã¢ã¼ããããã°ããç°å¢(Xdebug,PDT)ãä½ã£ã¦ã¿ã¾ãã ã¾ããXdebugãã¤ã³ã¹ãã¼ã«ãã¾ãã Linux(CentOS 4.3)ãã·ã³ã«ã¤ã³ã¹ãã¼ã«ãã¦ããapacheã¨PHPã®ãã¼ã¸ã§ã³ã¯ã次ã®éãã§ãã apache 2.2.0 PHP 5.2.3 (両æ¹ã¨ãã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«ãã¦ãã¾ãã) Xdebugã¯ããã¼ã¸ã§ã³2.0.2ãã¤ã³ã¹ãã¼ã«ãã¾ãã ã¤ã³ã¹ãã¼ã«åã®ç¢ºèª php-configã¨phpizeãå¿ è¦ã¨ã®ãã¨ã§ããã¹ãéã£ã¦ãããè¦ã¦ã¿ã¾ãã # which php-config # which phpize php-configã¨phpizeã¯ãPHPãã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«ãããã(?)ããã¤ã³ã¹ã
ã¯ã©ã¦ãã«å¯¾å¿ããã·ã¹ãã éçºå¼ç¤¾ã®è²©å£²ç®¡çã·ã¹ãã ã¯ãããã¤ã³ã¿ã¼ãããVPSãAWSãªã©ã®ã¯ã©ã¦ãä¸ã§åä½ãããã¾ãã ãããã¾ãã¨æãããããã¾ãããé常ã®ã·ã¹ãã ä¼ç¤¾ã¨ããã®ã¯ãç´åãã´ã¼ã«ããªãã§ãã ãã®ã·ã¹ãã ã顧客ã«ã¨ã£ã¦ææ義ãã©ããã¯éçºä¼ç¤¾ã«ã¨ã£ã¦ç¥ã£ããã£ã¡ããªãã®ã§ãã ããããè¦ä»¶å®ç¾©ã®éãä½ã£ã¦ç´åããã®ã§ãããã ããã§é¡§å®¢ã¯å¹¸ããªã®ã§ããããï¼ ç´åæã¯ï¼ããã®ã¹ã¿ã¼ãã§ã¯ãªããã³ã¹ããããã£ã¦ããã®ã§ãå®ã¯ãã¤ãã¹ããã®ã¹ã¿ã¼ãã§ãã 顧客ã«ã¨ã£ã¦ã·ã¹ãã æ§ç¯ã¨ãããã®ã¯ããã¾ã§ãã¸ãã¹ã®æ段ã§ãã£ã¦ç®çã§ã¯ãªãã¯ãã§ãã ç´åã¾ã§ãããã¦ç´åãã¦ããè¦ä»¶ãå¸å ´ãå¤ããã¾ãã ç§éã¯é¡§å®¢ã¨å¯¾å³ããã®ã§ã¯ãªã顧客ã¨åãæ¹åãåããã®ã ã¨ãããã¾ãã
Xdebugã¯ãPHPã«ãããã°æ©è½ãå®è£ ããããã®ã¢ã¸ã¥ã¼ã«ã§ãããã¨ãã¨PHPã« ã¯è¨èªã¬ãã«ã§ã®ãããã°æ©è½ããããã¡ã¤ã©ã¼ãç¨æããã¦ããããã¢ã¸ã¥ã¼ ã«ãã¤ã³ã¹ãã¼ã«ããå¿ è¦ãããã¾ãããPHPã§ãã®æ©è½ãå®ç¾ããããã®ã¢ ã¸ã¥ã¼ã«ã¨ãã¦ã以ä¸ã®ãããªãã®ãããã¾ãã Xdebug ï¼http://xdebug.org/ï¼ DBGï¼http://dd.cron.ru/ï¼ Advanced PHP Debuggerï¼http://pecl.php.net/package/apdï¼ ä»åã¯ãããã¡ã¤ã©ã¼ãå èµããææ°çã§ããPHP 5.1ã«ã対å¿ããXdebugã¨ã¯ ã¹ãã³ã·ã§ã³ã使ã£ã¦ããããã¡ã¤ã«ãè¡ãæ¹æ³ã説æãã¾ãã Xdebugã®ã¤ã³ã¹ãã¼ã« Xdebugã¯ã以ä¸ã®ã¨ããã¤ã³ã¹ãã¼ã«ãã¾ãã ï¼ï¼ã¢ã¸ã¥ã¼ã«ã®ä½æ Xdebugã¯PECLã®ï¼ã¤ãªã®ã§ãUnixã·ã¹ãã ã®å ´åã¯
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}