• php安装 出现Sorry, I cannot run apxs. ***错误解决方法


    # tar zvxf php-5.1.2.tar.gz
    # cd php-5.1.2
    # ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs --with-libxml-dir=/usr/local/include/libxml2/libxml --with-gd --with-zlib 
    # make 
    # make install
    #

    *** 注: 在configure过程中, 可能会遇到下面的错误! Sorry, I 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)

    configure: error: Sorry, I cannot run apxs. Either you need to install Perl or you need to pass the absolute path of apxs by using --with-apxs=/absolute/path/to/apxs

    网上有很多介绍解决方法的, 但最经典的只有Darrell Brogdon在2001/03/15写的<<Installing PHP as an Apache DSO>>, 这篇文章在绿盟有徐永久在2002-03-18翻译的中文版<<在Apache上以DSO方式安装PHP>>, 不过上面著名他本人就是文章的作者, 这点我表示怀疑.

    我之所以说这么多, 只是想说明目前我看到的方法, 没有能够真正解决这个问题的.

    OK, 下面我说明一下我是如何解决这个问题的:

    首先, 通过错误提示, 我们得知"I cannot run apxs". 我一直以为是apxs安装有问题, 但找了很久仍未得到合理的解释和解决方法.

    于是我直接运行"/usr/local/apache/bin/apxs"这个脚本, 得到下面的错误提示:

    bash: ./apxs: /replace/with/path/to/perl/interpreter: bad interpreter: No such file or directory

    哦, 给人的感觉很像仍然是apxs程序有问题, 但问题在哪里呢? "interpreter"是什么呢? interpreter是"解释程序"!

    嗯, 看来我们接近答案了, 运行"head -1 /usr/local/apache/bin/apxs"得到下面内容:

    #!/replace/with/path/to/perl/interpreter -w

    天啊, 这里没有指明正确的perl执行程序的位置! 原来这就才是真正的问题原因所在!!!

    把这一行更改为"#!/usr/bin/perl -w". 再运行php的configure, 一切正常!

    至此, 问题已解决.


  • 相关阅读:
    asp.net 曲线图
    asp.net 图片下载
    使用a标签删除进行提示
    asp.net 后台获取input的值
    asp.net Excel数据导入到数据库中
    asp.net DataSet数据导出到Excel中
    select top 所有
    asp.net 上一条和下一条记录的显示
    日期相减函数
    mybatis mapper学习1(补充)-mapper.xml映射文件生成补充
  • 原文地址:https://www.cnblogs.com/wajika/p/6559903.html
Copyright © 2020-2023  润新知