PHP Safe Mode
Tweaks to use Chameleon in PHP safe mode:
- have all the scripts and directories owned by apache (Linux only)
- add GDFONTPATH to the allowed list of environment variables (this is needed for the buttonizer which uses putenv):
safe_mode_allowed_env_vars = PHP_,GDFONTPATH
- make sure the wmsparse utility can be executed:
safe_mode_exec_dir =
/data/geoservices-50/apps/chameleon/htdocs/common/wmsparse/linux/
- add the Mapscript module to php.ini (extension=) since dl's are not allowed
-
extension=php_mapscript.so.4.8.1
In safe mode a few things are not permitted like using set_time_limit. You will receive a warning in the PHP error log, like:
01-May-2006 16:40:26 PHP Warning: set_time_limit():
Cannot set time limit in safe mode
in /data/geoservices/apps/chameleon/htdocs/common/wrapper/drawmap.php
on line 146
There are quite a few scripts in Chameleon which use set_time_limit. The only way to do this in safe mode is set the max_execution_time in php.ini. A good value to use for Chameleon is 600 (the value used in drawmap.php).
In order to suppress these error messages, the occurrences of set_time_limit have been replaced with @set_time_limit as of Chameleon 2.4.1.
This is an overview of the use of set_time_limit in Chameleon:
widgets/ExtractWFSData/ExtractWFSData.php: 120 seconds
widgets/PrintProduction/preview.php: 300 seconds
widgets/PrintProduction/production.inc.php: 300 seconds
widgets/Query/QueryResults.phtml: 120 seconds
widgets/WFSSearch/searchoptionapi.php: 300 seconds
widgets/query_utils.php: 120 seconds
common/wrapper/drawmap.php: 600 seconds
common/phpwms/server_data_manager.php: 300 seconds
Created by: bartvde last modification: Tuesday 02 of May, 2006 [16:21:03 UTC] by bartvde
|