From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnout Vandecappelle Date: Wed, 14 Sep 2016 02:03:35 +0200 Subject: [Buildroot] [PATCH v4,4/4] php: add apache support In-Reply-To: References: <1473632768-53238-1-git-send-email-fabrice.fontaine@orange.com> <1473632768-53238-4-git-send-email-fabrice.fontaine@orange.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: buildroot@busybox.net [Please don't top-post, but answer inline.] On 13-09-16 23:13, Fabrice Fontaine wrote: > Dear Arnout, > > You're right that the issue is linked to apxs however adding apxs to > APACHE_CONFIG_SCRIPTS does not solve the issue. > > I'll try to explain the problem. At the moment, the configuration file of apxs, > config_vars.mk , is patched in > APACHE_FIX_STAGING_APACHE_CONFIG to add STAGING_DIR as a prefix so apxs adds the > correct LoadModule directive in output/staging/etc/apache2/httpd.conf through > the following command: > > output/staging/usr/bin/apxs -S > LIBEXECDIR='/home/fabrice/buildroot-qemu/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/modules' > -S > SYSCONFDIR='/home/fabrice/buildroot-qemu/output/host/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/etc/apache2' > -i -a -n php7 output/build/php-7.0.9/libs/libphp7.so > > However, the same apxs in staging directory is also used to update the > output/target/etc/apache2/httpd.conf through the following command: > output/staging/usr/bin/apxs -S > LIBEXECDIR='/home/fabrice/buildroot-qemu/output/staging/usr/modules' -S > SYSCONFDIR='/home/fabrice/buildroot-qemu/output/staging/etc/apache2' -i -a -n > php7 output/build/php-7.0.9/libs/libphp7.so I guess here you meant target instead of staging... > > In this case, the prefix is wrong and apxs adds a wrong path in the LoadModule > directive. So that's the crux of the matter. apxs is smart enough to subsitute away prefix: my $dir = $CFG_LIBEXECDIR; $dir =~ s|^$CFG_PREFIX/?||; However, for the target install, LIBEXECDIR is overridden to the target directory, but PREFIX remains as staging directory. I've done a quick test, and passing an additional -S PREFIX $(TARGET_DIR)/usr for the target install seems to fix it. Now, is there a way to push this option down to the target install (only)? > We could fix the issue by updating APACHE_FIX_STAGING_APACHE_CONFIG to use the > TARGET_DIR instead of the STAGING_DIR. However, Yann's point of view was that > php package should not update apache configuration file. So, I will let you > decide what should be done. IMHO, Yann was wrong in that. It's very normal that package a that depends on package b will update some file that was originally generated by package b. That said, it is very convenient to use an approach like e.g. Debian, where each module has its own conf file, and can be enabled by linking to the conf file from /etc/apache2/mods-enabled. But that means we have to make a httpd.conf which is very different from upstream's. Regards, Arnout [snip] -- Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF