共计 1589 个字符,预计需要花费 4 分钟才能阅读完成。
在 linux 下安装 php 时,(我安装的时 5.2.6)phptar.gz 压缩包解压缩之后。
在分配路径和关联扩展包时遇到错误如下:
——————————————————–
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)
—————————————————
解决步骤:
1、根据不能 run apxs。cd 到 apache 的 bin 目录下运行./apxs 运行结果
—————————————————-
bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory
———————————————————
2、vim apxs 文件 找“/replace/with/path/to/perl/interpreter”关键字
在第一个行:#!/replace/with/path/to/perl/interpreter -w
根据 perl 的安装目录 /usr/bin/perl
修改为:#! /usr/bin/perl -w
3、运行第一步。或者直接 ./configure ^^^^^
问题解决
configure 代码如下:
./configure–prefix=/usr/local/php/–with-config-file-path=/usr/local/php/etc/–with-apxs2=/usr/local/apache2/bin/apxs–with-MySQL=/usr/local/mysql/–with-libxml-dir=/usr/local/libxml2/–with-jpeg-dir=/usr/local/jpeg6/–with-freetype-dir=/usr/local/freetype/–with-gd=/usr/local/gd2/–with-mcrypt=/usr/local/libmcrypt/–with-mysqli=/usr/local/mysql/bin/mysql_config–enable-soap–enable-mbstring=all–enable-sockets
推荐阅读 :
Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm
CentOS 5.9 下编译安装 LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm
RedHat 5.4 下 Web 服务器架构之源码构建 LAMP 环境及应用 PHPWind http://www.linuxidc.com/Linux/2012-10/72484p2.htm
LAMP 源码环境搭建 WEB 服务器 Linux+Apache+MySQL+PHP http://www.linuxidc.com/Linux/2013-05/84882.htm