FreeBSD升级PHP4的一些变化

昨天在 www.php.net 上看到 php4.3.10 发布了,而且官方严重建议立即升级,因为修补了一些严重的漏洞。

晚上12点一到,停掉 apache,然后 cvsup 一下,来到 /usr/ports/www/mod_php4,然后 make install。感觉有些异样,编译前的附加选项只有3个,其他例如 gd、mysql 的支持都没有。想了一下,还是看看 /usr/ports/UPDATING 再说,果然不幸言中,看下面这一段。

20040719: AFFECTS: users of PHP AUTHOR: ale@FreeBSD.org

The old lang/php4 and lang/php5 ports have been splitted into ‘base’ PHP,PEAR, and shared extensions to allow more flexibility and add new features. Upgrading your current PHP installation will result in a ‘base’ PHP installation (no PEAR and no extensions).PEAR can be found in the new devel/php4-pear and devel/php5-pear ports, while the set of PHP extensions to install can be choosen via the meta-ports lang/php4-extensions and lang/php5-extensions, or installing singular extensions individually. If you have a previous php.ini configuration file, be sure to comment out the extension_dir parameter, since the correct path is statically compiled into the PHP binary. For an overview of the modules used with the old PHP binary, use the command “php -m”.

这样就简单了,安装完 ‘base’ 后,然后到 /usr/ports/lang/php4-extension,make install,安装需要的模块。提示一下,如果选好相应的模块后,再想修改的话,研究一下 Makefiles,你会发现这样一个文件 /var/db/ports/php4-extension/options,修改或者删除它,你都会再有机会重新修改的。

安装完 extension 后,别忙启动 apache,最好用新生成的 php.ini-dist 来替换原来的 php.ini,然后再定制它,要问为什么,看上面的 UPDATING 好啦。

Post a Comment