Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question
add comment

2 Answers 2

I've found the solution to the problem.

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

share|improve this answer
add comment

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

http://centos.alt.ru/pub/php-fpm/

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

share|improve this answer
add comment

Your Answer

 
discard

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