mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
94 lines
1.8 KiB
Bash
Executable File
94 lines
1.8 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# Set our operating platform
|
|
PLATFORM=`cat /etc/platform`
|
|
|
|
PHPMODULES="apc \
|
|
bcmath \
|
|
bz2 \
|
|
ctype \
|
|
curl \
|
|
date \
|
|
gettext \
|
|
ldap \
|
|
libxml \
|
|
mbstring \
|
|
mhash \
|
|
pcntl \
|
|
pcre \
|
|
posix \
|
|
readline \
|
|
Reflection \
|
|
session \
|
|
shmop \
|
|
standard \
|
|
sysvmsg \
|
|
sysvsem \
|
|
sysvshm \
|
|
tokenizer
|
|
uploadprogress \
|
|
xml \
|
|
zlib"
|
|
|
|
mv /usr/local/etc/php.ini /tmp/
|
|
mv /usr/local/lib/php.ini /tmp/
|
|
LOADED_MODULES=`php -m | grep -v "\["`
|
|
|
|
|
|
# Populate a dummy php.ini to avoid
|
|
# the file being clobbered and the firewall
|
|
# not being able to boot back up.
|
|
cat >/usr/local/lib/php.ini <<EOF
|
|
; File generated from /etc/rc.php_ini_setup
|
|
output_buffering = "0"
|
|
expose_php = Off
|
|
implicit_flush = true
|
|
magic_quotes_gpc = Off
|
|
max_execution_time = 99999999
|
|
max_input_time = 99999999
|
|
register_argc_argv = On
|
|
file_uploads = On
|
|
upload_tmp_dir = /tmp
|
|
upload_max_filesize = 100M
|
|
post_max_size = 100M
|
|
html_errors = Off
|
|
zlib.output_compression = On
|
|
zlib.output_compression_level = 1
|
|
include_path = ".:/etc/inc:/usr/local/www:/usr/local/captiveportal:/usr/local/pkg"
|
|
uploadprogress.file.filename_template = /tmp/uploadprogress_%s.txt
|
|
extension_dir=/usr/local/lib/php/20060613/
|
|
|
|
; Extensions
|
|
EOF
|
|
|
|
# Loop through and generate modules to load.
|
|
# Take into account modules built into php.
|
|
for EXT in $PHPMODULES; do
|
|
SHOULDADD="true"
|
|
for LM in $LOADED_MODULES; do
|
|
if [ "$EXT" = "$LM" ]; then
|
|
SHOULDADD="false"
|
|
fi
|
|
done
|
|
if [ "$SHOULDADD" = "true" ]; then
|
|
echo "extension=${EXT}.so" >> /usr/local/lib/php.ini
|
|
fi
|
|
done
|
|
|
|
RAM=`sysctl hw.realmem | awk '{print $2/1000000}' | awk -F '.' '{print $1}'`
|
|
export RAM
|
|
if [ $RAM -gt 96 ]; then
|
|
|
|
cat >>/usr/local/lib/php.ini <<EOF
|
|
|
|
; APC Settings
|
|
apc.enabled="1"
|
|
apc.enable_cli="1"
|
|
apc.shm_size="25"
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
cp /usr/local/lib/php.ini /usr/local/etc/php.ini
|