Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:5464 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65644 invoked by uid 1010); 14 Nov 2003 14:19:21 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 65620 invoked from network); 14 Nov 2003 14:19:21 -0000 Received: from unknown (HELO postfix.spinodal.com) (206.40.55.227) by pb1.pair.com with SMTP; 14 Nov 2003 14:19:21 -0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by postfix.spinodal.com (Postfix) with ESMTP id D125BBEB70; Fri, 14 Nov 2003 06:19:18 -0800 (PST) In-Reply-To: References: <7FE65F30-160B-11D8-93AA-00039398D64A@php.net> Mime-Version: 1.0 (Apple Message framework v606) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: <87ABEC02-16AD-11D8-9DD7-00039398D64A@php.net> Content-Transfer-Encoding: 7bit Cc: PHP-DEV List Date: Fri, 14 Nov 2003 06:19:16 -0800 To: Jani Taskinen X-Mailer: Apple Mail (2.606) Subject: Re: [PHP-DEV] minor install issue (apache 1 sapi) From: tychay@php.net (terry chay) 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 | 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 >> >> >