Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the source directory:

./configure --prefix=/home/ashkan/Development/php/bin/php-5.2  --with-mysql --with-apxs2=/usr/bin/apxs2

make works fine but make install says:

Installing PHP SAPI module:       apache2handler
/usr/share/apache2/build/ SH_LIBTOOL='/usr/share/apr-1.0/build/libtool' /usr/lib/apache2/modules
/usr/share/apr-1.0/build/libtool --mode=install cp /usr/lib/apache2/modules/
libtool: install: cp .libs/ /usr/lib/apache2/modules/
cp: cannot create regular file `/usr/lib/apache2/modules/': Permission denied
apxs:Error: Command failed with rc=65536

UPDATE: reading man apxs2 it seems apxs compiles and then installs the module into apache module directory. This module directory seems to be fixed!

share|improve this question

No permission to copy binaries to /usr. Do sudo make install.

share|improve this answer
Tnx for your reply but as mentioned in the question, the problem is that --prefix is used with ./configure and the libtools is supposed to copy the module in the proper location and not the /usr/lib/apache2/module – ashy_32bit Mar 3 '13 at 9:59
Try putting --prefix in "" --prefix="/home/ashkan/Development/php/bin/php-5.2" – j0h Jan 20 '14 at 15:53
You could try tooling with the config file. I looked briefly. its not fixed "phplibdir" is it's assignment. you could try adding set -vx into the configure script to see what it is doing with your prefix directive. – j0h Jan 20 '14 at 16:04

Based on this blog article, if you specify INSTALL_ROOT the PHP apache module will try to install in that directory.

INSTALL_ROOT=/the/dir/path/to/install/in make install     

The other thing you might want to try adding this option to your ./configure of php-src:

--libexecdir=DIR        program executables [EPREFIX/libexec]
--sysconfdir=DIR        read-only single-machine data [PREFIX/etc]

as I believe those are being used in the Makefile

share|improve this answer
While your answer may be helpful , you need to improve so that it reflects its value .. here is how to write a good answer :) – Ahmed Jerbi Jun 9 at 20:01
My apologies Ahmed, I hope my answer is much better for you now. – PHPDave Jun 9 at 20:30
Much better thanks – Ahmed Jerbi Jun 9 at 20:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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