All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4,4/4] php: add apache support
Date: Tue, 13 Sep 2016 23:13:40 +0200	[thread overview]
Message-ID: <CAPi7W83YyYFDXDr_QAHtaijwJmvAZ+d0eFrSqj73Acqq_P+Vzg@mail.gmail.com> (raw)
In-Reply-To: <f2e1cea4-eda0-7c44-c5a6-a2d27499dfe3@mind.be>

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

In this case, the prefix is wrong and apxs adds a wrong path in the
LoadModule directive.
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.

Best Regards,

 he binary is correctly patched to install

2016-09-12 1:30 GMT+02:00 Arnout Vandecappelle <arnout@mind.be>:

>
>
> On 12-09-16 00:26, Fabrice Fontaine wrote:
> > Continue work started by Bernd Kuhls in
> > https://patchwork.ozlabs.org/patch/437544/
> >
> > Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> > Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
> > ---
> > Changes v3 -> v4 (after review of Yann Morin):
> >  - Do not select apache but depends on it
> >  - Move pthread detection fix in a separate patch
> >  - Remove unneeded configuration options such as --with-config-file-path
> >  - Do not allow php to update apache configuration file by removing -a
> >    argument from apxs call
> >
> > Changes v2 -> v3 (after review of Thomas Petazzoni):
> >  - Remove unneeded php-04-apache.patch
> >  - Fix pthread detection if Apache MPM is event or worker
> >  - Update pthread detection mechanism (--enable-pthreads does not exist
> >    anymore)
> >  - Remove unneeded --oldincludedir
> >  - Fix php module path
> >
> >  package/php/Config.in |  7 +++++++
> >  package/php/php.mk    | 22 ++++++++++++++++++++++
> >  2 files changed, 29 insertions(+)
> >
> > diff --git a/package/php/Config.in b/package/php/Config.in
> > index c90ad4f..e195fd4 100644
> > --- a/package/php/Config.in
> > +++ b/package/php/Config.in
> > @@ -14,6 +14,13 @@ if BR2_PACKAGE_PHP
> >  config BR2_PACKAGE_PHP_HAS_SAPI
> >       bool
> >
> > +config BR2_PACKAGE_PHP_SAPI_APACHE
> > +     bool "Apache"
> > +     depends on BR2_PACKAGE_APACHE
> > +     select BR2_PACKAGE_PHP_HAS_SAPI
> > +     help
> > +       Apache module
> > +
> >  config BR2_PACKAGE_PHP_SAPI_CGI
> >       bool "CGI"
> >       # CGI uses fork()
> > diff --git a/package/php/php.mk b/package/php/php.mk
> > index c4ff249..7abd012 100644
> > --- a/package/php/php.mk
> > +++ b/package/php/php.mk
> > @@ -95,6 +95,28 @@ PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_CLI),,-
> -disable-cli)
> >  PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_CGI),,--disable-cgi)
> >  PHP_CONF_OPTS += $(if $(BR2_PACKAGE_PHP_SAPI_FPM),--
> enable-fpm,--disable-fpm)
> >
> > +ifeq ($(BR2_PACKAGE_PHP_SAPI_APACHE),y)
> > +PHP_DEPENDENCIES += apache
> > +PHP_CONF_OPTS += --with-apxs2=$(STAGING_DIR)/usr/bin/apxs
> > +
> > +# Enable thread safety option if Apache MPM is event or worker
> > +ifeq ($(BR2_PACKAGE_APACHE_MPM_EVENT)$(BR2_PACKAGE_APACHE_
> MPM_WORKER),y)
> > +PHP_CONF_OPTS += --enable-maintainer-zts
> > +endif
> > +
> > +# php uses apxs from staging directory to install libphp dynamic
> library and
> > +# update /etc/apache2/httpd.conf through the -a option, here is the full
> > +# command line: "apxs -S LIBEXECDIR='$(INSTALL_ROOT)/usr/modules'
> > +# -S SYSCONFDIR='$(INSTALL_ROOT)/etc/apache2' -i -a -n php7
> > +# This does not work as apxs sets the full path of the library and not
> the
> > +# relative one so remove -a option from apxs call
>
>  Isn't the proper solution to add apxs to APACHE_CONFIG_SCRIPTS? Or is the
> staging dir encoded in a way that our sed script doesn't find it?
>
>  Regards,
>  Arnout
>
> > +define PHP_REMOVE_APXS_UPDATE_CONF
> > +     $(SED) 's/-i -a -n php/-i -n php/' $(@D)/configure
> > +endef
> > +
> > +PHP_PRE_CONFIGURE_HOOKS += PHP_REMOVE_APXS_UPDATE_CONF
> > +endif
> > +
> >  ### Extensions
> >  PHP_CONF_OPTS += \
> >       $(if $(BR2_PACKAGE_PHP_EXT_SOCKETS),--enable-sockets) \
> >
>
> --
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20160913/8128dead/attachment-0001.html>

  reply	other threads:[~2016-09-13 21:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11 22:26 [Buildroot] [PATCH v2,1/4] apache: add customization of MPM Fabrice Fontaine
2016-09-11 22:26 ` [Buildroot] [PATCH 2/4] php: rework selection of interfaces Fabrice Fontaine
2016-09-11 22:55   ` Arnout Vandecappelle
2016-09-11 22:26 ` [Buildroot] [PATCH 3/4] php: fix pthread detection Fabrice Fontaine
2016-09-11 23:21   ` Arnout Vandecappelle
2016-09-11 22:26 ` [Buildroot] [PATCH v4,4/4] php: add apache support Fabrice Fontaine
2016-09-11 23:30   ` Arnout Vandecappelle
2016-09-13 21:13     ` Fabrice Fontaine [this message]
2016-09-14  0:03       ` Arnout Vandecappelle
2016-09-11 22:39 ` [Buildroot] [PATCH v2,1/4] apache: add customization of MPM Arnout Vandecappelle
2016-09-12 21:15 ` Thomas Petazzoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPi7W83YyYFDXDr_QAHtaijwJmvAZ+d0eFrSqj73Acqq_P+Vzg@mail.gmail.com \
    --to=fontaine.fabrice@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.