10
./configure \
    --with-apxs2=/usr/local/apache/bin/apxs \
    --prefix=/usr/local/apache/php \
    --with-config-file-path=/usr/local/apache/php
make && make install

I see no critical errors during the configuration, and none during installation.

Apache is installed at /usr/local/apache, and the apxs has been verified to be correct.

/usr/local/apache/php is not being created and neither is libphp5.so being generated anywhere.

I'm installing 5.2.17 on centos.

EDIT: Here's the full configure command:

./configure \
    --with-apxs2=/usr/local/apache/bin/apxs \
    --with-mysql \
    --prefix=/usr/local/apache/php \
    --with-config-file-path=/usr/local/apache/php \
    --enable-force-cgi-redirect \
    --disable-cgi \
    --with-openssl \
    --with-mcrypt \
    --with-gd \
    --with-pdo-mysql \
    --without-sqlite \
    --without-sqlite3 \
    --enable-pdo \
    --without-pdo-sqlite \
    --with-zlib \
    --with-gettext \
    --with-gdbm \
    --enable-pcnlt \
    --with-curl
5
  • 1
    I believe libphp5.so should be in /usr/local/apache/modules.
    – netcoder
    Commented Feb 12, 2011 at 8:39
  • It's not there. There's just one file there httpd.exp
    – HyderA
    Commented Feb 12, 2011 at 8:46
  • Why don't you use yum in centos?
    – zerkms
    Commented Feb 12, 2011 at 9:16
  • I want to install 5.2.17, centos' latest repository store is 5.1.x. Also, I need some custom compile options such as --enable-pcntl
    – HyderA
    Commented Feb 12, 2011 at 9:31
  • 2
    Make sure you clean in-between attempts, otherwise it will build from previous makes. melikedev.com/2010/03/24/php-compilation-make-clean Commented Dec 6, 2011 at 0:30

1 Answer 1

16

As per the php INSTALL file (which I can't fault you for not reading in its entirety... I spent an hour on google before sitting down and reading the whole thing), you need to make sure apache is installed with

./configure --enable-so

before configuring and making php with

./configure --with-apxs2=/usr/local/apache2/bin/apxs 
2
  • Under osx i had to do the same: sudo ./configure --with-apxs2=/usr/sbin/apxs
    – ganchan
    Commented Mar 23, 2014 at 17:30
  • 1
    yum install httpd-devel Commented Jul 13, 2014 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.