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/
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
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.30157SOLUTION
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/
Jani,
Yes, this happens when I create an RPM, however this is still a bug.
Here is RPM's build process:
-
read spec file and look in /usr/src/redhat/SOURCES for files
necessary to build RPM -
configure and compile with settings targeted at "/"
-
make install into a temporary directory targetted at a temporary
directory -
if this succeeds, bundle sources and spec file into a source RPM
-
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' \
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
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.30157SOLUTION
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/
Jani,
Yes, this happens when I create an RPM, however this is still a bug.
Here is RPM's build process:
- read spec file and look in /usr/src/redhat/SOURCES for files
necessary to build RPM- configure and compile with settings targeted at "/"
- make install into a temporary directory targetted at a temporary
directory- if this succeeds, bundle sources and spec file into a source RPM
- 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.
This does affect the SAPIs for 2.0 too - we've historically patched that
out the unsubtle way, e.g.:
- if test -z
$APXS -q SYSCONFDIR
; then
- if true; then
INSTALL_IT="$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
...
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.
You can also see many of the patches by checking the archives for this
list, and the cvs archives where they get checked in :)
Regards,
joe