วันจันทร์, พฤษภาคม 29, 2549

Upgrade PHP from 4.4.1 to 5.1.4

Old Configuration:

PHP Version 4.4.1


Configure Command '/SourceCache/apache_mod_php/apache_mod_php-18.4/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--with-apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--with-mysql=/usr' '--with-mysql-sock=/var/mysql/mysql.sock'
Server API Apache
Virtual Directory Support disabled
Configuration File (php.ini) Path /private/etc/php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20050606
Debug Build no
Zend Memory Manager enabled
Thread Safety disabled
Registered PHP Streams php, http, ftp, compress.zlib

ขี้เกียจคอมไพล์เอง เลยอัพเดทแบบไบนารี่ เอามาจากเว๊บนี้ http://www.entropy.ch/software/macosx/php/#update

โหลดอันของ Apache 1.3 มาเพราะไม่อยากอัพเกรด Apache ไปเป็น ๒ ไม่งั้นคงลำบากน่าดู.
php5 ถูกติดตั้งลงไปที่ /usr/local/php5.
หลังจากติดตั้งแล้วสตาร์ทอะปาชี่ไม่ติดเพราะเหมือนกับว่า php4 และ php5 มันถูกโหลดทั้งคู่เลยตีกัน.
(php5 ถูกโหลดโดย /etc/httpd/users/+entropy-php.conf ซึ่งเป็น symbolic link ไปที่ /usr/local/php5/entropy-php.conf

ลองลบส่วนที่เป็นของ php4 ออก
แล้วอาศัยการ include โดยแยกส่วนที่ include php4 กับส่วนของ php5 ออกจากกันแล้วใช้การรีเนมเอา
Include /private/etc/httpd/users/*.conf
/private/etc/httpd/users/+php4.conf กับ +php5.conf