1. 程式人生 > >PHP編譯安裝命令

PHP編譯安裝命令

./configure \
--prefix=/usr/local/php \
--with-config-file-path=/usr/local/php/etc \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-libxml-dir \
--with-pcre-dir \
--with-mcrypt \
--with-openssl \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-xpm-dir \
--with-gettext \
--with-freetype-dir \
--with-bz2 \
--with-iconv-dir \
--with-zlib \
--with-zlib-dir \
--with-curl \
--with-xmlrpc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-icu-dir=/usr \
--enable-pcntl \
--enable-intl \
--enable-sockets \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--enable-ftp \
--enable-zip \
--enable-calendar \
--enable-mbstring \
--enable-exif \
--enable-soap \
--enable-wddx \
--enable-bcmath \
--enable-fd-setsize=4096 \
--disable-short-tags \
--disable-ipv6 \
--with-apxs2=/usr/sbin/apxs

yum install -y httpd httpd-devel

你在PHP的configure的時候,加上:
--with-apxs2=/usr/local/apache/bin/apxs
這樣就會自動編譯一個libphp5.so出來了。
注意:/usr/local/apache/bin/apxs 路徑要改成你自己的APACHE安裝路徑