阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

安装LAMP环境遇到Sorry, I cannot run apxs

113次阅读
没有评论

共计 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

正文完
星哥说事-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-20发表,共计1589字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中