ã¢ãã³ãªPHPã®éçºç°å¢ã®æ§ç¯æ¹æ³
- via. はてなブログ
誰ãæ¸ãããããªããã¨æãã¤ã¤ãã¾ããã決ã¾ãã®ãã¿ã¼ã³ã¨ãã¦PHPçãæ¸ãã¦ã¿ããã
PHPã®ãã¨è¦ã¦ãã¨ãæ¸ãæ¹ã¨ãåãå·»ãç°å¢ã£ã¦ããã¾å¤ãã£ã¦ãªããªã¼ã¨ãæãã¤ã¤ãããã¦ä½ãã¢ãã³ãªãã ã£ãï¼æ°ãããã°ããã®ãï¼ã£ã¦è©±ã ãã©ã
ä¸è¬ç㪠OSX ç°å¢ããã³ Linux ç°å¢ã«ããããã¢ãã³ãª PHP éçºç°å¢ã®æ§ç¯æ¹æ³ã«ã¤ãã¦ã¾ã¨ãã¦ã¿ããææ°ã®PHPã¨xdebugãããã°ååã
PHP 5.3.2 ã®ã¤ã³ã¹ãã¼ã«
ã½ã¼ã¹ããå
¥ãã¦ãææããããã©ãã£ã±ããã±ã¼ã¸ã楽ã ãªãããªãã£ã·ã£ã«ãããªããªãã¸ããªã使ãã°ããã±ã¼ã¸ã§å
¥ããããã
pearã¨peclã¯ãããã±ã¼ã¸å
¥ããã¨ãã«ä¸ç·ã«å
¥ãã¡ããã
pear ã pecl ãã®ãã®ã¯ãPHPãããé »ç¹ã«ãã¼ã¸ã§ã³ã¢ãããããããããã±ã¼ã¸ã«ãªã£ã¦ãããªã£ã¦ãªãã£ããã®ç®¡çãé¢åã ããåºæ¬çã«pear/peclã³ãã³ãã§ã
Mac OS X
Snow Leopardãªãããã©ã«ãã§PHP 5.3.1å ¥ã£ã¦ããããMac Portsããå ¥ããã®ããããªãPortsããå ¥ãã(Perl ã¯è±Portsã®æµããªã®ï¼)ãæè¿ã¯variantsã§å ¥ããã®ã§ã¯ãªãã¢ã¸ã¥ã¼ã«ãã¨ã«ããã±ã¼ã¸ãåããããããã«ãªã£ããã°ããã¼ããã§ãpearã³ãã³ãããpeclã³ãã³ãã®ããã« +pear ã¯å¿ è¦ã£ã¦ããã...
% sudo port install php5 +pear % sudo port install php5-mbstring
ports ã§å ¥ããPHPã使ãã«ã¯ããã¹ã®èª¿æ´ãå¿ è¦(以ä¸ã¯ãOpenSolaris(!)ãMac(ports), Linuxå ¨è¬å¯¾å¿ç)ã
PATH=$HOME/bin:/usr/gnu/bin:/opt/local/bin:/usr/local/bin:$PATH:/sbin:/usr/sbin
Debian
squeeze ãªãããã©ã«ã㧠PHP 5.3.3 ãå
¥ãã
以ä¸ã¯ãlenny ã®å ´åãdotdeb ãã PHP 5.3 ããã®aptããã±ã¼ã¸ãå
¥ããã
â»2012/1/19追è¨: dotdeb ã® source URLãå¤æ´ããã¦ãã¾ããmirror ãªã¹ãã®ä¸ãã Japan ã®ãã®ã使ãã°è¯ãã¨æãã¾ãã http://www.dotdeb.org/mirrors/
% sudo vim /etc/apt/sources.list #æ«å°¾ã«ä»¥ä¸ã®2è¡ã追å deb http://php53.dotdeb.org stable all deb-src http://php53.dotdeb.org stable all % sudo aptitude update % sudo aptitude install php5 php5-dev php-pear php5-mbstring
update ã®æç¹ã§ã以ä¸ã®ãããªã¨ã©ã¼ãåºãå ´åããããã
W: GPG error: http://php53.dotdeb.org stable Release: å ¬ééµãå©ç¨ã§ããªãããã以ä¸ã®ç½²åã¯æ¤è¨¼ã§ãã¾ããã§ãã: NO_PUBKEY E9C74FEEA2098A6E W: ãããã®åé¡ã解決ããããã«ã¯ apt-get update ãå®è¡ããå¿ è¦ãããããããã¾ãã
ãã®å ´åã¯ã以ä¸ã®ããã«å¯¾å¿ï¼åè Dotdeb packages are now signed! | Dotdeb)
% gpg --keyserver keys.gnupg.net --recv-key 89DF5277 % gpg -a --export 89DF5277 | sudo apt-key add -
CentOS
epelã¨remiã使ãã°yumã§å ¥ããremiã¯ããã©ã«ãã§enabledã«ãªããªãã®ã§ãenabledã«ããã
% sudo rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm % sudo rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm % sudo vim /etc/yum.repos.d/remi.repo ### [remi] ã»ã¯ã·ã§ã³ã§ 0 ã 1 ã« enabled=1 % sudo yum install php php-devel php-pear php-mbstring
xdebug
éçºç°å¢ãªãå½ç¶xdebugã¯å ¥ããã
% sudo pecl install xdebug
æå¾ã«iniã« extension=xdebug.so ã£ã¦æ¸ããã¨åºã¦ããããæ£ãã㯠zend_extensionãphp.ini ã«ã¯æ¸ããªãã§ãConfig File Scan Dir ã« xdebug.ini ã£ã¦ãã¡ã¤ã«ãä½æãã¦ãããã«æ¸ãã
- Mac OS X : /opt/local/var/db/php5/xdebug.ini
- Debian : /etc/php5/conf.d/xdebug.ini
- CentOS : /etc/php.d/xdebug.ini
ã«ã
zend_extension=/path/to/xdebug.so
ãè¨è¿°ãzend_extensionã«ã¯çµ¶å¯¾ãã¹ãæ¸ããªããã°ãããªãã®ã§ãåãããªãå ´å㯠pear config-show ã® ext_dir ãåèã«ãããã¨ã
deploy ã®ææ³
pearã®ãã£ã¬ã¯ããªãã¾ããã¨rsyncã§ããããªãpeclã¯ãã¢ã¼ããã¯ãã£ã«ãã£ã¦éãããåå¥ã«ã¤ã³ã¹ãã¼ã«ããã»ããè¯ãã
APC
éçºç°å¢ã«ã¯ xdebug å¿ é ã ãã©ãæ¬çªç°å¢ã«ã¯ãã£ã±APCã§ãããPHP 5.3対å¿çã¯betaã
% pecl install apc-beta
ã¡ã¢ãªãªã©ã®è¨å®ã¯ãpear ã® doc_dir ã® doc/APC/INSTALL ãåèã以ä¸ã¯debianã®å ´åã®ãã¡ã¤ã«ã®å ´åã
% sudo vim /etc/php5/conf.d/apc.ini extension=apc.so apc.enabled=1 apc.shm_segments=1 apc.shm_size=128M apc.ttl=7200 apc.user_ttl=7200 apc.num_files_hint=1024 apc.mmap_file_mask=/tmp/apc.XXXXXX apc.enable_cli=1
apc ã®ç®¡çç»é¢ã¯ãpear ã® php_dir ãã apc.php ãã¦ã§ãã§ã¢ã¯ã»ã¹åºæ¥ãå ´æã«ã³ãã¼ãã¦ä½¿ãã
è¤æ°ã¢ããªã±ã¼ã·ã§ã³ãéçºãã¦ãã¦ãããããã®ä¾åã¢ã¸ã¥ã¼ã«ããããããã¨ãªãå ´åã®éç¨
ã¢ããªã±ã¼ã·ã§ã³ä»¥ä¸ã« lib/ ãªã©ã¨ãã£ã¬ã¯ããªãä½ã£ã¦ããã®ä¸ã« pear ã³ãã³ããªã©ã§ããã±ã¼ã¸ãå ¥ããï¼ include_path ã調æ´ããã®ãè¯ã(ã¾ããã ããããã¬ã¼ã ã¯ã¼ã¯ããã£ã¦ãã)ã
ã¢ããªã±ã¼ã·ã§ã³ã®ä¸ã§ include_path ã調æ´ããã«ã¯ä»¥ä¸ã
<?php set_include_path('/path/to/lib' . PATH_SEPARATOR . get_include_path());
ã¡ãªã¿ã«ã·ã¹ãã ã®pearãã£ã¬ã¯ããªãããªãã¦ä»»æã®ãã£ã¬ã¯ããªã®pearã®ã¤ã³ã¹ãã¼ã«ãããã«ã¯ã .pearrc ãä½ãã°è¯ããkayacããã®ããã°ããåèã®ãã¨ã
ä½è«ã ãã©ãEthnaãªã pear-local ã³ãã³ãã£ã¦ãã¤ããããï¼
ç°ãªããã¼ã¸ã§ã³ã®PHPãã¾ã¨ãã¦å ¥ããå ´å
id:hnw å çã«ãã phpall ã使ã£ã¦å ¥ãããè¤æ°ç°å¢ã§ãã¹ããå®è¡ãããå ´åã«ã¯é常ã«å½¹ã«ç«ã¤ããã ããã¤ã³ã¹ãã¼ã«ã«ã¯æéãããã¾ããã
使ç¨ããPHPã®ãã¼ã¸ã§ã³ã®é¸å®
PHP 5.3.2 æä¸(2010/07/17ç¾å¨)ã
PHP 5.3.0ã®ãããã5.3ã¯ä½¿ã£ã¦ãããã©ãä»ã¯ã ãã¶å®å®ãã¦ãã(nequalã®ãµã¼ãã¹ã¯å
¨é¨PHP 5.3ã§åãã¦ãã)ããã£ã±åå空éãç¡åé¢æ°ä½¿ããããPHP 5.2.x 使ã£ã¦ã人ã移è¡ããå ´åã¯ãç¹ã«æ³¨æãã¹ãã¯E_DEPRECATEDããã以å¤ã¯ããã¨ãããªãããã¨ãããã
PHP 4ã¨ã使ã£ã¦ãå ´åãããã¾ä»ããæ¬å½ã«ä»ããã¨ã«ããä»ããJust NowãPHP 5ã«ã¢ããã°ã¬ã¼ãããã¹ãã§ããã
追è¨
ããã¯ããã§ã¤ã¤ï¼ã®ã ããå人çã«ã¯éçºç°å¢ã¨æ¬çªç°å¢ã¯æ¥µåãã¼ã¸ã§ã³ãããã±ã¼ã¸ãå«ãå®å ¨åä¸åããã»ããå¾ã§æ©ã¾ãããªãã¦ããã¨æããã¨ãããã¨ã§ãã¤ãä»®æ³åã
はてなブックマーク - Ryuzeeのブックマーク - 2010年7月18日
- åããã¤ãä»®æ³å(ã§ãããããã¯ã¾ãå¥ã®è©±)ããã¶ãä»®æ³åãã¹ããã£ã¦è©±ã¨ãã®ã¨ã³ããªèªä½ã¯å¯¾ç«ãã話ãããªãã¦ãä»®æ³åããä¸ã§ã®ç°å¢æ§ç¯æ¹æ³ãæ¬çªã¨éçºç°å¢ã®ãã¼ã¸ã§ã³ã¯å®å ¨åä¸åãã¹ãã§ããï¼ã¢ãã³ãªãã... ææ°ã®PHP 5.3.2ã§ã... ï¼çæ³ã¯ï¼ã