4
votes

[checking for Apache 2.0 handler-module support via DSO through 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)

The output of /usr/local/apache/bin/apxs follows: ./configure: line 6199: /usr/local/apache/bin/apxs: No such file or directory configure: error: Aborting]

it is the error suggest me the solution for this.

3

3 Answers

4
votes

When httpd -l does not list mod_so.c, DSO won't work, because it's an essential prerequisite; according to the documentation. Otherwise APXS can be installed with the package manager:

  • sudo dnf install httpd-devel (CentOS)

  • sudo apt-get install apache2-dev (Ubuntu)

This installs it as /usr/bin/apxs and ./configure --with-apxs works (without passing a path). One does not even have to install httpd / apache2, in order to use it's development tools - which then can be used to configure PHP with APXS.

1
votes

While installing Apache version greater than httpd-2.2 we have to install pcre, apr and apr-util separately and then ./configure

The right way to install apr and apr-util would be

cd httpd-2.4.37/srclib/apr 
./configure --prefix=/usr/local/apr/

cd ../apr-util
./configure --prefix=/usr/local/apr-util/ --with-apr=/usr/local/apr/

Its is better to check if there is some dependency package missing

cd  httpd-2.4.37
./buildconf

It may require to install these

yum install expat-devel

(xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory)

yum install libtool libtool-devel

(might be needed if not found in buildconf)

Now, once the buildconf finishes with 0 errors, we need to configure apache, like this

cd httpd-2.4.37
./configure --enable-debug --prefix=/usr/local/apache2 --with-apr=/usr/local/apr/ --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre

For detailed step by step installation, Visit

Install Latest Apache: Step by Step Procedure

Finally, while installing php,

./configure --with-apxs2=/opt/software/apache2/bin/apxs --enable-mbstring --with-mysql --with-mysqli --with-ldap=/usr/local
0
votes

Here is the apx path /usr/local/apache2/bin/apxs

My apache installation directory is /usr/local/apache2

Change directory php folder and run below command

./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