SliTaz Packages

Community Doc Forum Pro Shop Bugs Hg
.

Receipt for package "php-apache"

# SliTaz package receipt.

PACKAGE="php-apache"
VERSION="7.4.33"
CATEGORY="development"
SHORT_DESC="PHP module for apache."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="BSD"
WEB_SITE="https://www.php.net/"

PROVIDE="php:apache"
DEPENDS="apache libxml2 php-common zlib"
WANTED="php"

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
    mkdir -p $fs/usr/share
    cp -a $install/usr/share/apache    $fs/usr/share
}

# Post and pre install commans to stop
# and restart Web server if needed.
pre_install()
{
    if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
      then
        /etc/init.d/apache stop
    fi
}

post_install()
{
    grep -q php5_module "$1/etc/apache/httpd.conf" ||
    {
        sed -e 's|mod_rewrite.so|mod_rewrite.so\nLoadModule php7_module share/apache/modules/libphp7.so|' \
            -e 's|DirectoryIndex index.html|DirectoryIndex index.html index.php|' \
        -e 's|mime.types|mime.types\n    AddType application/x-httpd-php .php .php3 .php4 .php5 .php7\n    AddType application/x-httpd-php-source .phps|' \
            -i "$1/etc/apache/httpd.conf"
    }

    [ -f "$1/etc/apache/conf.d/phpinfo" ] || 
        cat > "$1/etc/apache/conf.d/phpinfo" <<EOT
<IfModule mod_alias.c>
    Alias /phpinfo /usr/share/phpinfo
</IfModule>
<DirectoryMatch /usr/share/phpinfo/>
    DirectoryIndex index.php
    Options +FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
    Require all granted
</DirectoryMatch>
EOT

    # Restart Web server.
    if [ -z "$1" -a -f "/var/run/apache/httpd.pid" ]
      then
        /etc/init.d/apache stop
        sleep 2
    fi
    if [ -z "$1" ]
      then
        /etc/init.d/apache start
    fi
}
6025 packages and 203154 files in current database (Thu Apr 25 06:17:47 2024)