archlinux测试环境编译一个php56的版本

archlinux编译一个php56的版本

# 下载
wget http://am1.php.net/get/php-5.6.38.tar.gz
# 关键参数
./configure \
--prefix=/vhs/php/php56 \
--exec-prefix=/vhs/php/php56 \
--bindir=/vhs/php/php56/bin \
--sbindir=/vhs/php/php56/sbin \
--includedir=/vhs/php/php56/include \
--libdir=/vhs/php/php56/lib \
--mandir=/vhs/php/php56/php/man \
--with-config-file-path=/vhs/php/php56/etc \
--with-mysql-sock= \
--with-mcrypt \
--with-mhash \
--with-openssl \
--with-mysql=shared,mysqlnd \
--with-mysqli=shared,mysqlnd \
--with-pdo-mysql=shared,mysqlnd \
--with-gd \
--with-iconv \
--with-zlib \
--enable-zip \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-xml \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-mbregex \
--enable-mbstring \
--enable-ftp \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--without-pear \
--with-gettext \
--enable-session \
--with-curl \
--with-jpeg-dir \
--with-freetype-dir \
--enable-opcache \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--without-gdbm \
--disable-fileinfo

编译php提示freetype-config not found.

# 下载https://download.savannah.gnu.org/releases/freetype/
cd /home
sudo wget https://download.savannah.gnu.org/releases/freetype/freetype-2.4.0.tar.bz2
sudo tar xvf freetype-2.4.0.tar.bz2
cd freetype-2.4.0
./configure --without-harfbuzz
sudo make
sudo make install
# sudo make && sudo make install

提示/home/php-5.6.38/ext/openssl/openssl.c:3485:14: 错误:dereferencing pointer to incomplete type ‘EVP_PKEY’ {或称 ‘struct evp_pkey_st’}

# 去掉,不能使用openssl生产环境请三思,影响支付等,当然arch也不会
--with-openssl

安装完成

Installing shared extensions:     /vhs/php/php56/lib/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary:        /vhs/php/php56/bin/
Installing PHP CLI man page:      /vhs/php/php56/php/man/man1/
Installing PHP FPM binary:        /vhs/php/php56/sbin/
Installing PHP FPM config:        /vhs/php/php56/etc/
Installing PHP FPM man page:      /vhs/php/php56/php/man/man8/
Installing PHP FPM status page:   /vhs/php/php56/php/php/fpm/
Installing PHP CGI binary:        /vhs/php/php56/bin/
Installing PHP CGI man page:      /vhs/php/php56/php/man/man1/
Installing build environment:     /vhs/php/php56/lib/build/
Installing header files:           /vhs/php/php56/include/php/
Installing helper programs:       /vhs/php/php56/bin/
  program: phpize
  program: php-config
Installing man pages:             /vhs/php/php56/php/man/man1/
  page: phpize.1
  page: php-config.1
/home/php-5.6.38/build/shtool install -c ext/phar/phar.phar /vhs/php/php56/bin
ln -s -f phar.phar /vhs/php/php56/bin/phar
Installing PDO headers:           /vhs/php/php56/include/php/ext/pdo/

如果使用fpm

# 复制默认的配置文件
sudo cp /vhs/php/php56/etc/php-fpm.conf.default /vhs/php/php56/etc/php-fpm.conf
# 修改,当前用户
sudo nano /vhs/php/php56/etc/php-fpm.conf
user = lxx
group = lxx
# 监听端口改为90002防止之前的90000冲突
listen = 127.0.0.1:90002
sudo /vhs/php/php56/sbin/php-fpm 

猜你喜欢

转载自blog.csdn.net/HD2killers/article/details/82775701