1.[root@yaho php-5.3.27]# useradd -s /sbin/nologin phpadmin
[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
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。