当我构建(配置)phpspreadsheet的源代码时,出现错误,找不到apxs并且未构建apache

San*_*han 5 php apache php-7 phpspreadsheet

[通过 APXS 通过 DSO 检查 Apache 2.0 处理程序模块支持...

抱歉,我无法运行 apxs。可能的原因如下:

  1. Perl 未安装
  2. 未找到 apxs。尝试使用 --with-apxs2=/path/to/apxs 传递路径
  3. Apache 不是使用 --enable-so 构建的(显示 apxs 使用页面)

/usr/local/apache/bin/apxs 的输出如下: ./configure: line 6199: /usr/local/apache/bin/apxs: No such file or directory configure: error: Aborting]

这是错误建议我解决这个问题。

Mar*_*ler 7

httpd -l不列出时mod_so.cDSO将不起作用,因为这是一个必要的先决条件;根据文档。否则APXS可以使用包管理器安装:

  • sudo dnf install httpd-devel(CentOS)

  • sudo apt-get install apache2-dev(乌班图)

这将安装它/usr/bin/apxs./configure --with-apxs运行(无需传递路径)。人们甚至不需要安装httpd/ apache2,就可以使用它的开发工具 - 然后可以使用它来PHP配置APXS.


小智 -1

这是apx路径 /usr/local/apache2/bin/apxs

我的apache安装目录是/usr/local/apache2

更改目录 php 文件夹并运行以下命令

./configure \
    --with-apxs2=/usr/local/apache2/bin/apxs \
    --with-curl=/usr \
    --with-gd \
    --with-gettext \
    --with-jpeg-dir=/usr \
    --with-freetype-dir=/usr \
    --with-kerberos \
    --with-openssl \
    --with-mcrypt=/usr/local/lib \
    --with-mhash \
    --with-mysql=mysqlnd \
    --with-mysqli=mysqlnd \
    --with-pcre-regex \
    --with-pear \
    --with-png-dir=/usr \
    --with-xsl \
    --with-zlib \
    --with-zlib-dir=/usr \
    --with-iconv \
    --enable-bcmath \
    --enable-calendar \
    --enable-exif \
    --enable-ftp \
    --enable-gd-native-ttf \
    --enable-soap \
    --enable-sockets \
    --enable-mbstring \
    --enable-zip \
    --enable-wddx
Run Code Online (Sandbox Code Playgroud)