I'm trying to make an RPM with PHP 5.3.1 and PHP-FPM 0.6 for CentOS 5.4. So far it goes quite well, but when rpmbuild gets to the installation phase it fails with the following error:

Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.63379
+ umask 022
+ cd /usr/src/redhat/BUILD
+ cd /usr/src/redhat/BUILD/php-5.3.1/fpm-build/
+ make install
Installing PHP SAPI module:       fpm
Installing PHP CLI binary:        /usr/bin/
cp: cannot create regular file `/usr/bin/#INST@12668#': Permission denied
make: *** [install-cli] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.63379 (%install)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.63379 (%install)

I am running rpmbuild as a normal user, so it's understandable that it will fail to install anything into /usr/bin, but it shouldn't try to install anything outside the buildroot in the first place. I have however specified the BuildRoot in the header of the spec file and I can see it is passed correctly to the make install command.

Does anyone have some idea of what is going wrong here?

Thanks a lot!


I've found the solution to the problem.

Adding INSTALL_ROOT=$RPM_BUILD_ROOT to the make install command solves it.


I found some RPMs at the following location. Both PHP 5.2 and 5.3.


I didn't have any problems downloading the src.rpms and recompiling for Fedora 10.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy