diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-12-23 19:25:46 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-12-23 19:25:46 +0000 |
commit | e1fda0c09f74f04c6928f18f18f3f9e9289b21e1 (patch) | |
tree | 29f54e6150bbef610f302ccebacacf71452b3e1f /etc | |
parent | 9060c76443f1863845af17fcaa53dc80060a905b (diff) | |
download | pfsense-e1fda0c09f74f04c6928f18f18f3f9e9289b21e1.zip pfsense-e1fda0c09f74f04c6928f18f18f3f9e9289b21e1.tar.gz |
Make rc.php_ini_setup smarter by testing final list of php modules for
loading errors. If a module did not load remove it from php.ini and
add the load error to /var/run/php_modules_load_errors.txt
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/rc.php_ini_setup | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/etc/rc.php_ini_setup b/etc/rc.php_ini_setup index abcd554..04c1c69 100755 --- a/etc/rc.php_ini_setup +++ b/etc/rc.php_ini_setup @@ -62,6 +62,7 @@ PHPMODULES="apc \ sysvmsg \ sysvsem \ sysvshm \ + sqlite \ tokenizer \ uploadprogress \ xml \ @@ -143,3 +144,33 @@ fi # Copy php.ini file to etc/ too (cli) cp /usr/local/lib/php.ini /usr/local/etc/php.ini + +# Remove old log file if it exists. +if [ -f /var/run/php_modules_load_errors.txt ]; then + rm /var/run/php_modules_load_errors.txt +fi + +# Check loaded modules and remove anything that did not load correctly +LOADED_MODULES=`php -m 2>/dev/null | grep -v "\["` +for EXT in $PHPMODULES; do + SHOULDREMOVE="true" + for LM in $LOADED_MODULES; do + if [ "$EXT" = "$LM" ]; then + SHOULDREMOVE="false" + fi + done + if [ "$SHOULDREMOVE" = "true" ]; then + if [ -f "${EXTENSIONSDIR}${EXT}.so" ]; then + echo ">>> ${EXT} did not load correctly. Removing from php.ini..." >> /var/run/php_modules_load_errors.txt + cat /usr/local/lib/php.ini | grep -v $EXT > /tmp/php.ini + mv /tmp/php.ini /usr/local/lib/php.ini + fi + fi +done + +# Copy php.ini file to etc/ too (cli) +cp /usr/local/lib/php.ini /usr/local/etc/php.ini + + + + |