Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 22735 - mod_php --enable-pcntl
Summary: mod_php --enable-pcntl
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Lowest enhancement (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords: EBUILD
Depends on:
Blocks:
 
Reported: 2003-06-13 01:37 UTC by Dominic Böttger
Modified: 2003-06-18 19:50 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Böttger 2003-06-13 01:37:06 UTC
mod_php has no --enable-pcntl support.
I had to add it manually in my ebuild.
Comment 1 Dominic Böttger 2003-06-13 01:39:43 UTC
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/dev-php/mod_php/mod_php-4.3.2.ebuild,v 1.4 2003/06/05 20:06:36 robbat2 Exp $

inherit php eutils

IUSE="${IUSE} apache2 pcntl"

DESCRIPTION="Apache module for PHP"
KEYWORDS="x86 sparc ppc alpha hppa ~arm ~sparc"
SLOT="0"
EXCLUDE_DB4_FIX=1
EXCLUDE_PEAR_FIX=1

DEPEND="${DEPEND}
        || (
        >=net-www/apache-1.3.26-r2
        apache2? ( >=net-www/apache-2.0.43-r1 )
        )"

src_compile() {
        #no readline on server SAPI
        myconf="${myconf} --without-readline"
        use pcntl && myconf="${myconf} --enable-pcntl"

        # Every Apache2 MPM EXCEPT prefork needs Zend Thread Safety
        if [ "`use apache2`" ]; then
                APACHE2_MPM="`apache2 -l |egrep 'worker|prechild|leader|threadpool|prefork'|xargs|cut -d. -f1`"
                case "${APACHE2_MPM}" in
                        prefork) ;;
                        *) myconf="${myconf} --enable-experimental-zts" ;;
                esac;
        fi

        # optional support for apache2
        #&& myconf="${myconf} --with-apxs2=/usr/sbin/apxs2" \
        #|| myconf="${myconf} --with-apxs=/usr/sbin/apxs"

        #use apache2 \
        has_version '>=net-www/apache-2' \
        && myconf="${myconf} --with-apxs2=/usr/sbin/apxs2" \
        || myconf="${myconf} --with-apxs=/usr/sbin/apxs"


        #php CGI stuff
        #--enable-discard-path --enable-force-cgi-redirect

        php_src_compile
}


src_install() {
        php_src_install

        cp php.ini-dist php.ini
        insinto /etc/php4
        doins php.ini

        if [ "`use apache2`" ] ; then
                dosym /usr/lib/apache2-extramodules /etc/php4/lib
                exeinto /usr/lib/apache2-extramodules
                doexe .libs/libphp4.so
                insinto /etc/apache2/conf/modules.d
                doins ${FILESDIR}/70_mod_php.conf
                dosym /etc/php4/php.ini /etc/apache2/conf/php.ini
        else
                dosym /usr/lib/apache-extramodules /etc/php4/lib
                exeinto /usr/lib/apache-extramodules
                doexe .libs/libphp4.so
                insinto /etc/apache/conf/addon-modules
                doins ${FILESDIR}/mod_php.conf
                dosym /etc/php4/php.ini /etc/apache/conf/php.ini
                dosym /etc/php4/php.ini /etc/apache/conf/addon-modules/php.ini
        fi
}

apache2msg() {
                einfo "Edit /etc/conf.d/apache2 and add \"-D PHP\""
}

pkg_postinst() {
        einfo "To have Apache run php programs, please do the following:"
        if [ "`use apache2`" ] ; then
                apache2msg
        else
                einfo "1. Execute the command:"
                einfo " \"ebuild /var/db/pkg/dev-php/${PF}/${PF}.ebuild config\""
                einfo "2. Edit /etc/conf.d/apache and add \"-D PHP\""
                einfo "That will include the php mime types in your configuration"
                einfo "automagically and setup Apache to load php when it starts."
        fi
}

pkg_config() {
        if [ "`use apache2`" ] ; then
                apache2msg
        else
                ${ROOT}/usr/sbin/apacheaddmod \
                        ${ROOT}/etc/apache/conf/apache.conf \
                        extramodules/libphp4.so mod_php4.c php4_module \
                        before=perl define=PHP4 addconf=conf/addon-modules/mod_php.conf
                        :;
        fi
}
Comment 2 Alessandro Pisani 2003-06-16 01:20:58 UTC
AFAIK pctnl is only used by the CLI version of php so it I think it is correct to have it enabled only in php and not in mod_php.
Comment 3 Dominic Böttger 2003-06-17 03:11:34 UTC
I don't think so. Look at php.net. I used it to split out a mailprocess from my mailfrontend. You're right, the main features of pcntl are used at the CLI for Multithreading, but you can use it for. I think it can be a very useful feature for big webprojects.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2003-06-18 19:50:46 UTC
Ok, i've made sure it is in both now (in next CVS commit)