PHP编译出错三例
1.[root@yaho php-5.3.27]# useradd -s /sbin/nologin phpadmin
成都创新互联是一家专注于网站设计、做网站与策划设计,容县网站建设哪家好?成都创新互联做网站,专注于网站建设十载,网设计领域的专业建站公司;建站业务涵盖:容县等地区。容县做网站价格咨询:13518219792
[root@yaho php-5.3.27]# yum install -y libtool-ltdl libtool-ltdl-devel #解决找不到lltdl文件问题
[root@yaho php-5.3.27]# rpm -ivh ftp://ftp.pbone.net/mirror/dl.iuscommunity.org/pub/ius/archive/Redhat/6/i386/epel-release-6-5.noarch.rpm #安装第三方yum源
[root@yaho php-5.3.27]#
yum install -y libmcrypt-devel #解决 缺少mcrypt加密件的问题
[root@yaho php-5.3.27]# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc--enable-fpm --with-fpm-user=phpadmin --with-fpm-group=phpadmin --with-MySQL=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --enable-zend-multibyte --disable-ipv6 --with-pear --with-curl=/usr/bin/ --with-openssl ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=php-fpm --with-fpm-group=php-fpm --with-mysql-dir=/usr/local/mysql --with-mysql-sock=/tmp/mysql.sock --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-ftp --enable-mbstring --enable-exif --enable-zend-multibyte --disable-ipv6 --with-pear--with-curl=/usr/bin/--with-openssl
[root@yaho php-5.3.27]# make
[root@yaho php-5.3.27]# make install
[root@yaho php-5.3.27]# done
当编译时提示mysql 配置错误信息,可尝试将--with-mysql=/usr/local/mysql 修改为:--with-mysql-dir=/usr/local/mysql。蓝色必加项
2.提示错误:
cannot run apxs. ***
Sorry, I cannot run apxs. Possible reasons follow:
1. Perl is not installed
2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
3. Apache was not built using --enable-so (the apxs usage page is displayed)
因为yum了perl,perl-devel后还提示同样错误,apxs文件也的确存在,想不出答案就百度了一下,原来是由于 PHP 的configure文件没有指定perl程序的路径导致代码不能被编译。
[root@php]#vi configure
把里面的第一句替换成:#!/usr/bin/perl -w 然后保存。再./configure 就正常了。
3.报错:configure: error: mysql configure failed. Please check config.log for more information.
为php增加mysql模块时报错
configure: error: mysql configure failed. Please check config.log for more information.
解决方法:
[root@localhost mysql]$ ./configure --with-php-config=/usr/local/bin/php-config --with-mysql-dir=/usr --with-zlib-dir
而非
[root@localhost mysql]$ ./configure --with-php-config=/usr/local/bin/php-config --with-mysql=/usr --with-zlib-dir
当前文章:PHP编译出错三例
网页URL:http://hbruida.cn/article/gsdscd.html