CentOS5.5ã®PHPãææ°çã«ã¢ããã°ã¬ã¼ããã
CentOSãä»ã®ãã£ã¹ããªãã¥ã¼ã·ã§ã³ã«æ¯ã¹ã¦ä¸çªãã¡ãã¡ãªã¨ããã¯ãRPMã®ã¬ãã¸ããªã«ç»é²ããã¦ããå種ã©ã¤ãã©ãªã®ãã¼ã¸ã§ã³ãã¨ã«ããå¤ããã¨ãªãã ãª(´ã»Ïã»ï½)
PHPã5.1.6ã¨å¤ãã®ã§ãã¼ã¸ã§ã³ã¢ãããããã¨ã«ããã
ã°ã°ã«ã¨ããããutterãªãã¡ããã¨ãremiãªãã¡ããã¨ãã®ã¬ãã¸ããªãrpm importãã¦ä½¿ãï¼ã¨ãã£ã¦ãããµã¤ããããã¾ãããããããã®ã¯ä¿¡ããªã主義ãªã®ã§èªåã§ã½ã¼ã¹ããï½²ï¾ï½½ï½ºããã
PHPãã½ã¼ã¹ããã¤ã³ã¹ã³ããã¨ãã¯ãlibxml2, apache-apxs2, libmysqlclientã«ä¾åããã®ã§ããããå ã«å ¥ããã
libxml2ã®éçºããã±ã¼ã¸ãã¤ã³ã¹ãã¼ã«ã
# cd /usr/local/src/ ï¼èªåã§ãããã½ã¼ã¹ã³ã¼ãã¯ããã«éãã主義ï¼
# yum install libxml2
# yum install libxml2-devel確èªã
# whereis libxml2
libxml2: /usr/local/lib/libxml2.a /usr/local/lib/libxml2.la /usr/local/lib/libxml2.so
apxs2ãå ã«ã¤ã³ã¹ãã¼ã«ãã¦ãããããã¯http-develããã±ã¼ã¸ã«å ¥ã£ã¦ããã
# yum install httpd-devel
# whereis apxs
apxs: /usr/sbin/apxs /usr/share/man/man8/apxs.8.gz
(ãã¹ãéãã¦ãã)
# export PATH=$PATH:/usr/sbin/
libmysqlclientã¯mysql-develããã±ã¼ã¸ã«å ¥ã£ã¦ãã
äºåã«RPMçã®PHP5.1.6ãåé¤ã
PHPã®ã½ã¼ã¹ææ°çãphp.netãããã¦ã³ãã¼ããã¦ãã¦ã¤ã³ã¹ãã¼ã«ã
# tar xvjf php-5.3.6.tar.bz2
# cd php-5.3.6/
# make clean (念ã®ãã)
# export LDFLAGS="-L/usr/lib64/mysql" (64bitçã®å ´å)
# ./configure --prefix=/usr --with-apxs2=/usr/sbin/apxs --enable-mbstring --enable-mbregex --with-mysql --with-mysql-sock=/var/lib/mysql/mysql.sock --with-pdo-mysql --enable-zend-multibyte --with-zlib-dir=/usr/lib --with-config-file-path=/etc/
-
- with-config-file-pathãæå®ããªãã¨ãã®ããã©ã«ããã¹ã¯ /usr/local/lib/php.ini ã¨ãªãã®ã§æ³¨æãCentOSã®ããã©ã«ãã§ã¯/etc/php.iniã«ãªã£ã¦ããã®ã§åãããã
- apxs2ã®ãã¹ã¯whereis apxsã¨ããã¨ãããã
- prefixã®ãã¹ã¯ã¾ã¤ã³ã«/ãä»ããªããwith-config-fileã®ãã¹ã¯æå¾ã«/ãä»ããç¹ã«æ³¨æã
pearã¨ãã¯ç¹ã«--disable-pearã¨ãããªãéãèªåçã«å ¥ãã®ã§å¤§ä¸å¤«ã
# make
# make install
php.iniãã³ãã¼ã
# cp php.ini-production /etc/php.ini
# ln -s /etc/php.ini /usr/local/lib/php.ini
ã½ã¼ã¹ããã¤ã³ã¹ãã¼ã«ããphp.iniã¯ä»¥ä¸ã®3ç®æãä¿®æ£ããå¿ è¦ãããã®ã§æ³¨æã
- display_errors = Off ã«å¤æ´ (ããã©ã«ãã§Onã«ãªã£ã¦ãã)
- short_open_tag = On ã«å¤æ´ (ãã¾ãæ¨å¥¨ããã¦ãªããã©ã<?=$var?>å½¢å¼ã使ããªãã¨ããã¤ãã®ãªã¼ãã³ã½ã¼ã¹ã¯æ£ããåä½ããªãã®ã§ã)
- date.timezone = Asia/Tokyo ã追å ã(ãªãã¨Warningãåºã¾ãã)
ãã¨ã¯ã好ã¿ã§ã
ã¤ã³ã¹ãã¼ã«çµæã¯æ¬¡ã®ããã«ãã¦ç¢ºèªï¼ä¿åãã¦ããã¨å¾ã§ä¾¿å©ã
# php --info > phpinfo.txt
Apacheåèµ·åã
# /sbin/service httpd restart