summaryrefslogtreecommitdiffstats
path: root/etc/rc.php_ini_setup
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-07-30 20:11:08 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-07-30 20:11:08 -0400
commitcddedb4083488a8d93b9bcbd18c47db8b1a1ae3e (patch)
tree0fe4fda2d4544aa417d55f84eb755bd811b02895 /etc/rc.php_ini_setup
parent38b52836ad538f390d3f8a691b96a5532122dab3 (diff)
downloadpfsense-cddedb4083488a8d93b9bcbd18c47db8b1a1ae3e.zip
pfsense-cddedb4083488a8d93b9bcbd18c47db8b1a1ae3e.tar.gz
Ensure apc is disabled by setting to 0. Also enable suhosin php support for < 65 megabytes of ram, too
Diffstat (limited to 'etc/rc.php_ini_setup')
-rwxr-xr-xetc/rc.php_ini_setup27
1 files changed, 27 insertions, 0 deletions
diff --git a/etc/rc.php_ini_setup b/etc/rc.php_ini_setup
index 870db1c..eaaac6f 100755
--- a/etc/rc.php_ini_setup
+++ b/etc/rc.php_ini_setup
@@ -43,6 +43,12 @@ fi
# Calculate APC SHM size according
# to detected memory values
+if [ "$AVAILMEM" -lt "65" ]; then
+ APCSHMEMSIZE="1"
+fi
+if [ "$AVAILMEM" -lt "96" ]; then
+ APCSHMEMSIZE="10"
+fi
if [ "$AVAILMEM" -lt "128" ]; then
APCSHMEMSIZE="10"
fi
@@ -192,6 +198,27 @@ done
# Get amount of ram installed on this system
RAM=`sysctl hw.realmem | awk '{print $2/1000000}' | awk -F '.' '{print $1}'`
export RAM
+if [ $RAM -lt 65 ]; then
+ cat >>/usr/local/lib/php.ini <<EOF
+; APC Settings
+apc.enabled="0"
+apc.enable_cli="0"
+apc.shm_size="1"
+
+[suhosin]
+suhosin.get.max_array_depth = 5000
+suhosin.get.max_array_index_length = 256
+suhosin.get.max_vars = 5000
+suhosin.post.max_array_depth = 5000
+suhosin.post.max_array_index_length = 256
+suhosin.post.max_vars = 5000
+suhosin.request.max_array_depth = 5000
+suhosin.request.max_array_index_length = 256
+suhosin.request.max_vars = 5000
+
+EOF
+
+fi
if [ $RAM -gt 96 ]; then
cat >>/usr/local/lib/php.ini <<EOF
OpenPOWER on IntegriCloud