diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-10-10 00:38:04 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-10-10 00:38:04 +0000 |
commit | adf4b76827a6e495eed3c5f2a4f06346cd3410f5 (patch) | |
tree | 6f467a9ae7ffe5df96997e8af166805803d8fa8f /etc/inc | |
parent | 632e8d54da47ba7c02ed5dd3d7cab544315bea8a (diff) | |
download | pfsense-adf4b76827a6e495eed3c5f2a4f06346cd3410f5.zip pfsense-adf4b76827a6e495eed3c5f2a4f06346cd3410f5.tar.gz |
* Dynamically create php.ini on bootup
* Do not use APC for embedded machines. Advice from #lighttpd
Diffstat (limited to 'etc/inc')
-rw-r--r-- | etc/inc/system.inc | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc index 4f41c4f..5d54ee5 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -32,6 +32,52 @@ /* include all configuration functions */ require_once("functions.inc"); +function opcode_cache_configuration() { + /* get system memory amount */ + $memory = get_memory(); + $avail = $memory[0]; + + /* disable apc for platforms less than 90 megs of ram */ + if($memory > 90) { + $opcode_cacher = "extension=apc.so\n"; + $opcode_cacher .= "apc.enabled=\"1\"\n"; + $opcode_cacher .= "apc.enable_cli=\"1\"\n"; + $opcode_cacher .= "apc.shm_size=\"30\"\n"; + } else { + $opcode_cacher = ""; + } + + /* create a php.ini variable */ + $php_conf = file_get_contents("/usr/local/lib/php.ini"); + +$php_ini = <<<EOFF +output_buffering = "0" +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 +include_path = ".:/etc/inc:/usr/local/www:/usr/local/captiveportal:/usr/local/pkg" +extension=radius.so +{$opcode_cacher} + +EOFF; + + conf_mount_rw(); + + /* open up php.ini and write back out contents */ + $fd = fopen("/usr/local/lib/php.ini","w"); + fwrite($fd, $php_ini); + fclose($fd); + + conf_mount_ro(); +} + function system_resolvconf_generate($dynupdate = false) { global $config, $g; if(isset($config['system']['developerspew'])) { |