Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
php [2006/05/25 19:32] greebo |
php [2010/02/20 14:43] (current) greebo |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== PHP tips ====== | ====== PHP tips ====== | ||
| ===== Instalation tips ===== | ===== Instalation tips ===== | ||
| + | |||
| + | |||
| + | FIXME | ||
| + | |||
| + | |||
| Line 7: | Line 12: | ||
| For a start, put disable_functions = " | For a start, put disable_functions = " | ||
| + | < | ||
| + | expose_php = Off | ||
| + | display_errors = Off | ||
| + | allow_url_fopen = Off | ||
| - | expose_php | + | session.use_trans_sid |
| - | display_errors = Off \\ | + | session.use_only_cookies = 1 |
| - | allow_url_fopen = Off \\ | + | |
| + | # | ||
| + | |||
| + | #per vhost: | ||
| + | php_admin_flag safe_mode On | ||
| + | php_admin_value open_basedir "/ | ||
| + | php_admin_value sendmail_from webmaster@example.com | ||
| + | |||
| + | |||
| + | php_admin_flag | ||
| + | php_admin_value safe_mode_include_dir "/ | ||
| + | # | ||
| + | php_admin_value default_charset " | ||
| + | |||
| + | </ | ||
| + | |||
| + | **PHP to secure a setup, a good start is a secure php.ini, for example: | ||
| + | * disable the Fopen Wrapper, **allow_url_fopen** = Off | ||
| + | * use disable_classes and disable_functions like: - ini_alter, ini_get_all, | ||
| + | * set **register_globals = off** | ||
| + | * set log_errors = on, error_reporting and error_log | ||
| + | * use **open_basedir** and include_path | ||
| + | * use **safe_mode** if possible | ||
| + | |||
| + | < | ||
| + | allow_call_time_pass_reference = Off | ||
| + | magic_quotes_gpc = Off | ||
| + | register_long_arrays = Off | ||
| + | register_argc_argv | ||
| + | allow_url_fopen = Off | ||
| + | expose_php = Off | ||
| + | disable_functions = symlink, | ||
| + | </ | ||
| + | |||
| + | |||
| + | === see also: === | ||
| + | * **[[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| - | # | ||
| - | TODO | ||
| Line 29: | Line 75: | ||
| ==== Zend Optimizer ==== | ==== Zend Optimizer ==== | ||
| === Instalation === | === Instalation === | ||
| - | Get Zend optimizer from [[http:// | + | Get Zend optimizer from [[http:// |
| **'' | **'' | ||
| Line 58: | Line 104: | ||
| make | make | ||
| make install | make install | ||
| + | |||
| + | --without-eaccelerator-use-inode [bug with open_basedir - safe mode] | ||
| * See [[http:// | * See [[http:// | ||

