多年前的笔记-生产环境编译PHP5.6.21
文章目录
下载PHP
wget -c http://ar2.php.net/distributions/php-5.6.21.tar.bz2
解压
tar xf php-5.6.21.tar.bz2 && cd php-5.6.21
php5.6.21编译参数
./configure \
--prefix=/app/php56 \
--with-config-file-path=/app/php56/etc \
--enable-fpm \
--with-fpm-user=php-fpm \
--with-fpm-group=php-fpm \
--with-openssl \
--with-mcrypt \
--enable-mbstring \
--disable-pdo \
--with-curl \
--enable-opcache \
--disable-debug \
--disable-rpath \
--enable-inline-optimization \
--with-bz2 \
--with-zlib \
--enable-sockets \
--enable-sysvsem \
--enable-sysvshm \
--enable-pcntl \
--enable-mbregex \
--with-mhash \
--enable-zip \
--with-pcre-regex \
--with-freetype-dir \
--with-mysql \
--with-mysqli \
--with-gd \
--with-xmlrpc \
--enable-ftp \
--with-jpeg-dir
开发反映无法加载验证码,后来同事编译添加了–with-freetype-dir参数
#php5.6.22编译参数
./configure --prefix=/app/php \
--with-config-file-path=/app/php/etc \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-iconv-dir \
--with-freetype-dir \
--with-jpeg-dir \
--with-png-dir \
--with-zlib \
--with-libxml-dir= \
--enable-xml \
--disable-rpath \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-inline-optimization \
--with-curl \
--enable-mbregex \
--enable-mbstring \
--with-mcrypt \
--enable-ftp \
--with-gd \
--enable-gd-native-ttf \
--with-openssl \
--with-mhash \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-zip \
--enable-soap \
--with-gettext \
--disable-fileinfo \
--enable-opcache \
--enable-intl \
--with-xsl
确认编译成功
Build complete.
Don't forget to run 'make test'.'
Installing shared extensions: /APP/php56/lib/php/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary: /APP/php56/bin/
Installing PHP CLI man page: /APP/php56/php/man/man1/
Installing PHP FPM binary: /APP/php56/sbin/
Installing PHP FPM config: /APP/php56/etc/
Installing PHP FPM man page: /APP/php56/php/man/man8/
Installing PHP FPM status page: /APP/php56/php/php/fpm/
Installing PHP CGI binary: /APP/php56/bin/
Installing PHP CGI man page: /APP/php56/php/man/man1/
Installing build environment: /APP/php56/lib/php/build/
Installing header files: /APP/php56/include/php/
Installing helper programs: /APP/php56/bin/
program: phpize
program: php-config
Installing man pages: /APP/php56/php/man/man1/
page: phpize.1
page: php-config.1
Installing PEAR environment: /APP/php56/lib/php/
[PEAR] Archive_Tar - installed: 1.4.0
[PEAR] Console_Getopt - installed: 1.4.1
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util - installed: 1.3.0
[PEAR] PEAR - installed: 1.10.1
Wrote PEAR system config file at: /APP/php56/etc/pear.conf
You may want to add: /APP/php56/lib/php to your php.ini include_path
/APP/php-5.6.21/build/shtool install -c ext/phar/phar.phar /APP/php56/bin
ln -s -f phar.phar /APP/php56/bin/phar
[[email protected] php-5.6.21]# echo $?
0
配置PHP
准备配置文件
/bin/cp -av php.ini-production /app/php56/etc/php.ini
PHP服务
/bin/cp -av /app/php56/etc/php-fpm.conf.default /app/php56/etc/php-fpm.conf
/bin/cp -av sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm56
chmod +x /etc/init.d/php-fpm56
启动PHP
/APP/php56/sbin/php-fpm
修改FPM 配置文件php-fpm.conf
pm.max_children = 50
pm.start_servers = 20
pm.min_spare_servers = 5
pm.max_spare_servers = 35
pm.max_requests = 500
标签:enable,php56,21,--,APP,编译,PHP,PHP5.6,php
From: https://blog.csdn.net/weixin_36518466/article/details/137402240