[ "$DEBIAN_SCRIPT_DEBUG" ] && set -vx
-# Source debconf library.
-. /usr/share/debconf/confmodule
-
case "$1" in
configure)
# continue below
PKG="php5-cn"
A2MODEDIR="/etc/apache2/mods-enabled"
-EXTENSIONS="mysql ldap gd"
+EXTENSIONS="mysql"
PHP5DIR="/etc/php5"
PHP5CONFD="/etc/php5/conf.d"
fi
-# Check if PHP5 extensions (MySQL, LDAP, GD) are enabled.
+# Check if PHP5 extensions are enabled.
#
for php5ext in $EXTENSIONS; do
# configuration files.
for SAPI in apache apache2 cgi cli; do
- ini_file="$PHP5DIR/$SAPI/php.ini"
+ if [ -d "$PHP5DIR/$SAPI" ]; then
+
+ ini_file="$PHP5DIR/$SAPI/php.ini"
- if [ -f "$ini_file" ]; then
+ if [ -f "$ini_file" ]; then
cp_echo "CN: Removing $php5ext extension from file $ini_file"
cp_check_and_sed "$php5ext_re" \
"/$php5ext_re/d" \
"$ini_file" && need_restart=1 || true
- fi
+ fi
+ fi
done
+ # Check $PHP5CONFD directory.
+ if [ ! -d "$PHP5CONFD" ]; then
+ cp_echo "CN: Creating configuration directory $PHP5CONFD"
+ mkdir $PHP5CONFD
+ fi
+
# Check extension configuration in /etc/php5/conf.d/ directory.
if [ ! -f "$PHP5CONFD/$php5ext.ini" ]; then
#
for SAPI in apache apache2 cgi cli; do
+ if [ ! -d "$PHP5DIR/$SAPI" ]; then
+ continue
+ fi
+
ini_file="$PHP5DIR/$SAPI/php.ini"
cp_echo "CN: Checking and enabling some CARNet specific parameters in file $ini_file"
-
+
if [ -f "$ini_file" ]; then
cp_check_and_sed "^[[:space:]]*upload_max_filesize[[:space:]]*=[[:space:]]*2M$" \
's/^[[:space:]]*upload_max_filesize[[:space:]]*=.*/upload_max_filesize = 256M/' \
"$ini_file" && need_restart=1 || true
- cp_check_and_sed "^[[:space:]]*post_max_size[[:space]]*=[[:space:]]*8M$" \
+ cp_check_and_sed "^[[:space:]]*post_max_size[[:space:]]*=[[:space:]]*8M$" \
's/^[[:space:]]*post_max_size[[:space:]]*=.*/post_max_size = 256M/' \
"$ini_file" && need_restart=1 || true
if [ $need_restart -eq 1 ]; then
# Check Apache2 web server configuration.
- if apache2ctl configtest 2>/dev/null; then
+ if /usr/sbin/apache2ctl configtest 2>/dev/null; then
# Restart Apache2 web server.
if [ -x "/etc/init.d/apache2" ]; then
if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
- invoke-rc.d apache2 restart || exit $?
+ invoke-rc.d apache2 force-reload || true
else
- /etc/init.d/apache2 restart || exit $?
+ /etc/init.d/apache2 force-reload || true
fi
fi
else