幸福

如人饮水,冷暖自知

在阿里云编译PHP过程中的细节

先贴出一段常规的编译配置:(注:不要有换行,否则报错)

./configure –prefix=/usr/local/php –with-mysql=/usr/local/mysql –with-openssl —
enable-fpm –enable-sockets –enable-sysvshm –with-
mysqli=/usr/local/mysql/bin/mysql_config –enable-mbstring –with-freetype-dir –with-
jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr/ –enable-xml –with-mhash
–with-mcrypt –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d —
with-bz2 –with-curl –with-gd –enable-zip –with-pear

因为我的阿里云是最“低档”的配置,内存512M,所以用上述常规配置编译会报错:

make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1

这是由于内存小于1G所导致,需要在./configure加上选项:–disable-fileinfo  Disable fileinfo support 禁用 fileinfo

重新整理后则为:(注:不要有换行,否则报错)

./configure –prefix=/usr/local/php –with-mysql=/usr/local/mysql –with-openssl —
enable-fpm –enable-sockets –enable-sysvshm –with-
mysqli=/usr/local/mysql/bin/mysql_config –enable-mbstring –with-freetype-dir –with-
jpeg-dir –with-png-dir –with-zlib –with-libxml-dir=/usr/ –enable-xml –with-mhash
–with-mcrypt –with-config-file-path=/etc –with-config-file-scan-dir=/etc/php.d —
with-bz2 –with-curl –with-gd –enable-zip –with-pear –disable-fileinfo

 

1419237955141858.jpeg

至此完美解决!

 

 



去打赏

您的支持将鼓励我们继续创作!

[微信] 扫描二维码打赏

[支付宝] 扫描二维码打赏

点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注