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)
The output of /usr/local/apache/bin/apxs follows:./configure: line 6669: /usr/local/apache/bin/apxs: No such file or directoryconfigure: error: Aborting
.解决方法:根据英文提示我们可以看到如下几点:perl没有安装,指定正确的apxs路径
于是进行如下操作
#yum install -y
perl*
#yum install -y
httpd-devel
#find / -name apxs 得到的路径是:/usr/sbin/apxs
于是修改--with-apsx2=/usr/sbin/apxs指定到正确路径
最后正确执行
apxs在/usr/sbin/目录里面,修改正确路径就没有问题了
./configure
\
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache2/bin/apxs \
# 修改为“/usr/sbin/apxs"即可
--with-config-file-path=/usr/local/php/etc
\
--with-mysql=/usr/local/mysql \
--with-libxml-dir \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--with-freetype-dir \
--with-iconv-dir \
--with-zlib-dir \
--with-bz2 \
--with-openssl \
--with-mcrypt \
--enable-soap \
--enable-gd-native-ttf \
--enable-mbstring \
--enable-sockets \
--enable-exif \
--disable-ipv6
可能接着出现如下报错:mcrypt.h not found. Please reinstall libmcrypt.
解决方法详见:http://blog.sina.com.cn/s/blog_b5dfe4870102wasu.html