- if [ -e "$A2MODEDIR/php5.load" ]; then
- cp_echo "CN: Disabling PHP5 module for Apache2 web server"
- a2dismod php5 >/dev/null || true
- need_restart=1
+ if [ -e "$A2MODEDIR/php5.load" ]; then
+ cp_echo "CN: Disabling PHP5 module for Apache2 web server"
+ a2dismod php5 >/dev/null || true
+ need_restart=1
+ fi
+ if [ ! -e "$A2MODEDIR/php4.load" ] || [ ! -e "$A2MODEDIR/php4.conf" ]; then
+ cp_echo "CN: Enabling PHP4 module for Apache2 web server"
+ a2enmod php4 >/dev/null || true
+ need_restart=1
+ fi
+fi
+
+
+# Check for PHP4 SAPI directories and configuration files.
+#
+for SAPI in apache2 cli; do
+
+ if [ ! -d "$PHP4DIR/$SAPI" ]; then
+ cp_echo "CN: Creating configuration directory $PHP4DIR/$SAPI/"
+ mkdir -p $PHP4DIR/$SAPI/