讨论 PHP最新版编译心路历程

YxMingY

【Lv:4】

注册
2018/03/17
消息
163
金粒
13,794.70金粒
不久前,php发布了最新版7.3.0的beta版
作为一个有理想的PHP开发者,怎么能不马上弄下来编译安装呢?
首先,下载
Bash:
wget "https://downloads.php.net/~cmb/php-7.3.0beta1.tar.gz" -O m && tar -zxvf m && cd php*
接着,安装大部分所需
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(哭晕)
 

附件

  • -1c255d488c81a60d.jpg
    -1c255d488c81a60d.jpg
    267.7 KB · 查看: 4
  • 喜欢
反馈: YYT
最后一个bug貌似不是beta版造成的,请大佬看看
 

在线会员

  • acg17
  • Squannd
  • GoldenSunset
  • 星辰BR
  • 今晚打老虎
  • 贰壹
  • Eternal_Star
  • Miko_Chisayo
  • 波旬W
  • Silvigarabis
  • hhhhGG
  • 小安鱼
  • liubo520
  • laiyipianVC
  • Sunny23
  • RIM
  • HIG
  • 10_27
  • PaulWong
  • 699
...和 4 更多。
后退
顶部 底部