环境:contos 6.3

硬件:memory 512mb

问题:

编译安装 php 5.6.11 时遇到错误:

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

解决方法:

由于内存小于1GB 所导致,在./configure时加上选项 --disable-fileinfo ,Disable fileinfo support ( 禁用 fileinfo ):

# ./configure --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --enable-exif --with-gd --with-jpeg-dir --with-png-dir --with-openssl --with-zlib-dir --with-freetype-dir --enable-gd-native-ttf --with-mhash --enable-mbstring --with-mcrypt --with-mysqli --enable-pcntl --enable-opcache --with-pdo-mysql --with-openssl-dir --with-libxml-dir --enable-sockets --enable-zip --enable-soap --with-pear --without-sqlite3 --without-pdo-sqlite --disable-fileinfo

默认安装路径:

# make install
Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-20131226/
Installing PHP CLI binary:        /usr/local/bin/
Installing PHP CLI man page:      /usr/local/php/man/man1/
Installing PHP FPM binary:        /usr/local/sbin/
Installing PHP FPM config:        /usr/local/etc/
Installing PHP FPM man page:      /usr/local/php/man/man8/
Installing PHP FPM status page:      /usr/local/php/php/fpm/
Installing PHP CGI binary:        /usr/local/bin/
Installing PHP CGI man page:      /usr/local/php/man/man1/
Installing build environment:     /usr/local/lib/php/build/
Installing header files:          /usr/local/include/php/
Installing helper programs:       /usr/local/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/lib/php/
[PEAR] Archive_Tar    - installed: 1.3.12
[PEAR] Console_Getopt - installed: 1.3.1
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util       - installed: 1.2.3
[PEAR] PEAR           - installed: 1.9.5
Wrote PEAR system config file at: /usr/local/etc/pear.conf
You may want to add: /usr/local/lib/php to your php.ini include_path
/root/php-5.6.11/build/shtool install -c ext/phar/phar.phar /usr/local/bin
ln -s -f phar.phar /usr/local/bin/phar
Installing PDO headers:          /usr/local/include/php/ext/pdo/

标签: centos, php, fileinfo

添加新评论