我的PHP编译选项 (更新到7.0)

========= 更新: 7.0 选项 =========
./configure --prefix=/usr/local/php7 --with-config-file-path=/etc/php7/php.ini --with-config-file-scan-dir=/etc/php7/php.d --with-mysqli --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --with-tidy --enable-sockets --enable-zip --with-pdo-mysql

较之之前的 5.x 版本, mysql 扩展已经被移除了.

========= 更新: 5.x 选项 =========
./configure --prefix=/usr/local/php --with-config-file-path=/etc/php --with-mysql --with-mysqli --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-sockets --with-pdo-mysql --with-tidy --enable-zip --enable-opcache

========= 以往编译选项 =========

1. 首先打上 fpm 补丁

gzip -cd php-x.x.x-fpm-x.x.x.diff.gz | patch -d php-x.x.x -p1

2. 用于开发测试需要大量的扩展, PDO另外编译所以disable掉了
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql --with-mysqli --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-sockets --disable-pdo

3. 编译安装

make ZEND_EXTRA_LIBS='-liconv'
make install

发表评论

电子邮件地址不会被公开。 必填项已用*标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据