Re: minor install issue (apache 1 sapi)

From: Date: Fri, 14 Nov 2003 14:19:16 +0000
Subject: Re: minor install issue (apache 1 sapi)
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-5464@lists.php.net to get a copy of this message
Jani, Yes, this happens when I create an RPM, however this is still a bug. Here is RPM's build process: 1) read spec file and look in /usr/src/redhat/SOURCES for files necessary to build RPM 2) configure and compile with settings targeted at "/" 3) make install into a temporary directory targetted at a temporary directory 4) if this succeeds, bundle sources and spec file into a source RPM 5) bundle temporary directory and spec file into binary RPM First, it is perfectly valid that I create a php package against my installed apache. In fact, this is how Red Hat does it themselves and the only valid way to safely replace an RPM with a non-distribution one (this is why you should normally compile into /opt or /usr/local). The reason Fedora hasn't found this bug has to do with the fact that the later versions of Red Hat (since 9.0?) link against Apache 2 which doesn't have this bug. Second, this does not apply specifically to the RPM build process, it applies generically to any build process that doesn't install the files directly, uses a late version PHP 4.3.3+ and links against Apache 1.3. It also applies to anyone (PHP 4.3.3+/Apache 1.3) doing a make install to a target directory (mostly these are packagers). Third, if apxs modifies any files in the file system that aren't built, my patch doesn't work--instead, one would have to build out a new httpd.conf file from the current one by perl and a lot of needless but necessary complexity. (But I don't believe this is the case since I think apxs is like the apache version of phpize.) Take care, terry P.S. The Fedora PHP RPM is an absolute mess. It applies 12 patches and separately compiles the cgi/sapi modules even though PHP has long since built out both when you compile the SAPI. I don't know if there is anything interesting in there, but you can download it from them and apply "rpm2cpio <sourcetarball> | cpio -ivmud" and rummage around at the patches. This is the patch I applied (obviously my SPEC is much different from Fedora's because I'm compiling against 1.3 instead of 2.0). --- php-4.3.3/sapi/apache/config.m4.orig Thu Nov 13 11:04:05 2003
+++ php-4.3.3/sapi/apache/config.m4       Thu Nov 13 11:04:41 2003
@@ -80,7 +80,7 @@
                        $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
                              -i -n php4 $SAPI_SHARED"
     else
-      APXS_SYSCONFDIR='$(INSTALL_ROOT)'$APXS -q SYSCONFDIR
+      APXS_SYSCONFDIR=$APXS -q SYSCONFDIR
       APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                       \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
                        $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
On Nov 13, 2003, at 4:20 PM, Jani Taskinen wrote:
    This happens while _creating_ the rpm? In that case,
    I wouldn't call it a bug..you shouldn't be creating the
    package against your installed apache, but the one you're
    gonna package too.
    Diclaimer: this is purely 'common sense' guess as I have never
               done any rpms of php myself.
    --Jani
On Thu, 13 Nov 2003, terry chay wrote:
I'm not too sure this belongs here or on PHP-INST (there was a message by Dinesh Anchan back in July 17 on PHP-INST where the replier wasn't helpful to the poor guy). In any case... I'm running into a minor issue, easily patched, installing PHP 4.3.3+ on Apache 1.3. PROBLEM Creating a php RPM script linked against apache 1.3 fails during install with an error: apxs: Error: Config file /var/tmp/php-root/etc/httpd/conf/httpd.conf not found make: *** [install-sapi] Error 1 error: Bad exit status from /var/tmp/rpm-tmp.30157 SOLUTION In php/sapi/apache/config.m4 replace the line: APXS_SYSCONFDIR='$(INSTALL_ROOT)' APXS -q SYSCONFDIR with APXS_SYSCONFDIR=APXS -q SYSCONFDIR EXPLANATION: When php installs mod_php, it executes apxs with a reference to SYSCONFDIR (i.e. "apxs -S SYSCONFDIR='/etc/httpd/conf'). If the above solution isn't applied and your packager script does something like: make install INSTALL_ROOT=/some/temp/dir then as it stands, apxs will now look for a file that doesn't exist (/some/temp/dir/etc/httpd/conf/httpd.conf) and crap out. Take care, terry -- terry chay <mailto:tychay@php.net> <http://homepage.mac.com/tychay/>


« previous php.internals (#5464) next »