Home | Mirror | Search

第 14 章 install and configure

目錄

1. php.ini
1.1. Time Zone
1.2. open_basedir
1.3. disable_functions
1.4. disable_classes
1.5. 隱藏php本版信息
$ sudo apt-get install php5
$ sudo apt-get install php5 php5-cli
	

fastcgi

sudo apt-get install php5
sudo apt-get install php5-cli
sudo apt-get install php5-fpm
	

1. php.ini

1.1. Time Zone

date.timezone = "Asia/Chongqing"

date.timezone = "Asia/Shanghai"
			
大陸內地可用的值是:Asia/Chongqing ,Asia/Shanghai ,Asia/Urumqi (依次為重慶,上海,烏魯木齊)
港台地區可用:Asia/Macao ,Asia/Hong_Kong ,Asia/Taipei (依次為澳門,香港,台北)
還有新加坡:Asia/Singapore
其他可用的值是:Etc/GMT-8 ,Singapore ,Hongkong ,PRC (中華人民共和國)
			

php 代碼中加入:

date_default_timezone_set ("Asia/Chongqing");
			

1.2. open_basedir

open_basedir = "/var/www/foo.bar/:/usr/local/php/:/tmp/"
			

1.3. disable_functions

disable_functions = phpinfo,
			

檔案目錄

chdir,chroot,dir,getcwd,opendir,readdir,scandir,mkdir,rmdir,unlink,delete,copy,rename

fopen,file,file_get_contents,fputs,fwrite,

			

權限

chgrp,chmod,chown
			

Shell 安全

exec, system, shell_exec, escapeshellcmd, escapeshellarg, proc_get_status, proc_open
			

php.ini 安全

ini_set, ini_alter, max_execution_time
			

1.4. disable_classes

disable_classes=
			

1.5. 隱藏php本版信息

expose_php On
改成
expose_php Off
			
comments powered by Disqus