PHP编译出错三例-创新互联

1.[root@yaho php-5.3.27]# useradd -s /sbin/nologin phpadmin

创新互联公司是一家业务范围包括IDC托管业务,网络空间、主机租用、主机托管,四川、重庆、广东电信服务器租用,联通服务器托管,成都网通服务器托管,成都服务器租用,业务范围遍及中国大陆、港澳台以及欧美等多个国家及地区的互联网数据服务公司。

[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

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


当前名称:PHP编译出错三例-创新互联
地址分享:http://pwwzsj.com/article/giiod.html