php 常用编译参数
安装依赖
yum install -y gcc gcc-c++ make zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
'./configure' '--prefix=/app/php' '--with-config-file-path=/app/php/etc' '--with-config-file-scan-dir=/app/php/etc/php.d' '--with-fpm-user=www' '--with-fpm-group=www' '--enable-fpm' '--enable-opcache' '--disable-fileinfo' '--enable-mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--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-exif' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl=/usr/local' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-ftp' '--enable-intl' '--with-xsl' '--with-gettext' '--enable-zip' '--enable-soap' '--disable-debug'
默认配置文件目录:/app/php/etc/php.ini 如果 编译指令里面未指定具体文件,则默认放在编译目录下的/etc/中
note:如果是编译升级PHP版本,且需要支持apache , 则一定要加上--with-apxs2 表示支持apache2以上的版本
编译扩展模块:
#cd /usr/local/src/php-7.0.14/ext
#cd 扩展模块目录
#phpize
#./configure --with-php-config=/usr/local/php/bin/php-config
#make && make install
添加扩展模块 修改php.ini文件 php.ini文件目录可通过 php -i|grep php.ini来查看
extension = "module.so"