不久前,php发布了最新版7.3.0的beta版
作为一个有理想的PHP开发者,怎么能不马上弄下来编译安装呢?
首先,下载
Bash:接着,安装大部分所需
yum install libxml2 libxml2-devel openssl openssl-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel gcc gcc-c++ -y
安装好后就可以configure了
./configure --prefix=/usr/local/bin/php/ --enable-fpm --with-fpm-user=www --with-fpm-group=www --enable-mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir=/usr/local/freetype --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=/usr/local/curl --enable-mbregex --enable-mbstring --enable-intl --enable-pcntl --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-maintainer-zts --enable-pthreads --with-libdir=lib64
出现问题:
checking for location of ICU headers and libraries... not found.configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
解决办法:
yum -y install libicu*
再次configure
提升缺少libzip,yum安装,版本过低
编译安装
wget https://nih.at/libzip/libzip-1.2.0.tar.gz && tar -zxvf libzip-1.2.0.tar.gz && cd libzip-1.2.0 ./configure && make && make install
再次configure,报错
checking size of off_t... 0
configure: error: off_t undefined; check your library configuration
查百度,得解决方法
echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf&&ldconfig -v
最后configure,通过
make,报错找不到
/usr/local/include/zipconf.h
解决:
cp /usr/local/lib/libzip/include/*.h /usr/local/include/
再次make && make install,通过
复制php.ini
cp php.ini-development /usr/local/bin/php/bin/php.ini
编译过程大概就是这样。。
编译pthreads扩展时,出现神奇bug(如图)
-----
结言: beta有bug,想要愉快使用还请release(哭晕)