Opened 10 years ago

Closed 10 years ago

#4844 closed defect (fixed)

Build PHP without zts

Reported by: Pierre Labastie Owned by: Pierre Labastie
Priority: normal Milestone: 7.6
Component: BOOK Version: SVN
Severity: normal Keywords:
Cc:

Description

Use a sed from Arch Linux (found by Fernando):

      sed '/APACHE_THREADED_MPM=/d' \
          -i sapi/apache2handler/config.m4 \
          -i configure

Otherwise, some packages using PHP may not build, with errors:

tsrm_ls undeclared

Change History (8)

comment:1 by Pierre Labastie, 10 years ago

Owner: changed from blfs-book@… to Pierre Labastie

comment:2 by Pierre Labastie, 10 years ago

Status: newassigned

comment:3 by Pierre Labastie, 10 years ago

The sed may not be the best route (thanks to Armin K). Actually, the apache server does not start anymore if built with threaded MPM and that sed is applied (the php module is not thread safe).

It'd be better to go along the php-fpm route. It is a daemon, which processes fastcgi requests sent to its listening socket (default 127.0.0.1:9000, there is no possibility for a unix socket).

Apache 2.4 has a module mod_proxy_fcgi, which may used for transforming access to php files into fastcgi requests to the right socket.

comment:4 by Pierre Labastie, 10 years ago

I have an issue with the build creating a directory /usr/php/fpm (to store a status page). I do not understand how it is possible. Normally, the directory is ${datadir}/fpm, which should default to /usr/share/fpm. That may not be the best place either for a status page, but at least it is a known place. Looks like there is a bug in the build system, but since it is rather complicated, I have not yet figured out where...

comment:5 by Pierre Labastie, 10 years ago

Here are the commands I use if someone wants to reproduce. DESTDIR install actually use INSTALL_ROOT:

cd /sources/php
# the tarball is already present
tar -xvf php-5.5.10.tar.bz2
cd php-5.5.10
sed -i -e 's/2.6.5 2.7/& 3.0/' configure
./configure --prefix=/usr                \
            --sysconfdir=/etc            \
            --mandir=/usr/share/man      \
            --enable-fpm                 \
            --with-fpm-user=apache       \
            --with-fpm-group=apache      \
            --localstatedir=/var/run     \
            --with-config-file-path=/etc \
            --with-zlib                  \
            --enable-bcmath              \
            --with-bz2                   \
            --enable-calendar            \
            --enable-dba=shared          \
            --with-gdbm                  \
            --with-gmp                   \
            --enable-ftp                 \
            --with-gettext               \
            --enable-mbstring            \
            --with-readline
make -j5
make INSTALL_ROOT=/sources/php/dest install

comment:6 by bdubbs@…, 10 years ago

I used the instructions and looked at the installation directories. There are a couple of problems with ./sapi/fpm/Makefile.frag. It is installing the PHP FPM status page in $(datadir)/fpm/. That should be PREFIX/share which would end up at /usr/share/php. Perhaps we should use --datadir=/usr/share/php explicitly.

The second problem is that it is creating empty directories at $(localstatedir)/{log,run} where localstatedir is /var/run. For us, this is a symlink to /run. I don't know if these files need to be persistent across boots or not, but the safe thing to do would be to use /var/cache/php. OTOH just /var would create /var/{run,log} which might be better.

I still do need the command: sed -i -e 's/2.6.5 2.7/& 3.0/' configure

Retesting, --datadir=/usr/share/php and --localstatedir=/var seem to do the right thing.

in reply to:  6 comment:7 by Pierre Labastie, 10 years ago

Replying to bdubbs@…:

Retesting, --datadir=/usr/share/php and --localstatedir=/var seem to do the right thing.

Thanks, will use that (sorry for the late reply, I caught the flu, and have been hardly able to work).

comment:8 by Pierre Labastie, 10 years ago

Resolution: fixed
Status: assignedclosed

Fixed at r12909

Note: See TracTickets for help on using tickets.