ÈçºÎ½«php»ñµÃµÄʱ¼äת»»Îª±±¾©Ê±¼ä
´Óphp5.10¿ªÊ¼£¬phpÖмÓÈëÁËʱÇøµÄÉèÖã¬ÔÚphpÖÐÏÔʾµÄʱ¼ä¶¼ÊǸñÁÖÍþÖαê׼ʱ¼ä£¬Õâ¾ÍÔì³ÉÁËÎÒÃÇÖйúµÄÓû§»á²î°Ë¸öСʱµÄÎÊÌ⣡
Ïà¹ØÉèÖÃÊÇÐÞ¸Äphp.iniÖÐµÄ date.timezone ²ÎÊý£º
[Date]
; Defines the default timezone used by the date functions
;date.timezone =
ĬÈÏÊǹرյģ¬Ö»Ðè°Ñ×¢ÊÍÈ¥µô£¬¸ÄΪ¼´¿É
[Date]
; Defines the default timezone used by the date functions
date.timezone = PRC
ÆäÖÐPRCÊÇ“ÖлªÈËÃñ¹²ºÍ¹ú”£¡
ÆäËûÑ¡Ïî¿ÉÒԲο¼phpÊֲᡣ
²»¹ýÕâÉÏÃæµÄÑÇÖÞµØÇø©µôÁËÎÒÃǵÄÊ׶¼±±¾©£¬²»ÖªµÀÀÏÍâÊDz»ÊǹÊÒâµÄ£¡
Èç¹ûûÓÐÐÞ¸Äphp.iniµÄȨÏÞ£¬Ö»ÐèÒªÔÚµ÷ÓÃʱ¼äÈÕÆÚº¯ÊýµÄʱºò£¬µ÷Óà date_default_timezone_set(’PRC’) ¼´¿É£¡
Ò²¿ÉÒÔµ÷ÓÃdate_default_timezone_get()À´²é¿´µ±Ç°µÄʱÇøÉèÖã¡
關ì¶XXX£¬´ó陸內µØ¿ÉÓõÄÖµÊÇ£º
Asia/Chongqing £¬Asia/Shanghai £¬Asia/Urumqi £¨ÒÀ´Î為ÖØ慶£¬ÉϺ££¬烏魯ľ齊)
¸Ų̂µØ區¿ÉÓãºAsia/Macao £¬Asia/Hong_Kong £¬Asia/Taipei £¨ÒÀ´Î為°Ä門£¬Ïã¸Û£¬Ì¨±±£©
̨灣µØÇø¿É設為£ºdate.timezone = "Asia//Taipei"
還ÓÐмÓÆ£ºAsia/Singapore
PHP5ÖеÄʱ¼äÏà²î°ËСʱµÄ½â¾ö°ì·¨
°²×°ºÃphp5ºó£¬ÔÚÂÛ̳²»¾Òâ¼ä£¬ÔÚÂÛ̳ÉÏ¿´µ½ÓÐÈË˵php5.1.2µÄʱ¼äÏÔʾÕûÕûÉÙ8¸öСʱ£¬
<?php
echo date("Y-m-d H:i:s");
?>
½á¹û×Ô¼º²âÊÔ¹ûÈ»ÊÇÏà²î8Сʱ¡£
ºóÀ´¾¹ýÔÚÂÛ̳ÉÏÕÒ×ÊÁÏ£¬½á¹ûÖÕÓÚ½â¾ö£¬ÔÚphp5ÒÔ¼°ÆðÒÔÉϵİ汾£¬ÒªÊä³ö±¾µØµÄʱ¼ä£¨ÏÞÖйú£©£¬¿ÉÒÔÕâôд´úÂ룺
<?php
date_default_timezone_set('Asia/Shanghai');
echo date('Y-m-d H:i:s');
?>
Ò²¿ÉÒÔÕâÑùд´úÂë:
<?php
date_default_timezone_set('Asia/Chongqing');
echo date('Y-m-d H:i:s');
?>
ÕâÑù ʱ¼äÏà²î°ËСʱµÄÎÊÌâ¾Í½â¾öÁË!!~~~
Ïà¹ØÎĵµ£º
Output Control
º¯Êý¿ÉÒÔÈÃÄã×ÔÓÉ¿ØÖƽű¾ÖÐÊý¾ÝµÄÊä³ö¡£Ëü·Ç³£µØÓÐÓã¬ÌرðÊǶÔÓÚ£ºµ±ÄãÏëÔÚÊý¾ÝÒѾÊä³öºó£¬ÔÙÊä³öÎļþÍ·µÄÇé¿ö¡£Êä³ö¿ØÖƺ¯Êý²»¶ÔʹÓÃ
header()
»ò
setcookie(),
·¢Ë͵ÄÎļþÍ·ÐÅÏ¢²úÉúÓ°Ïì
,
Ö»¶ÔÄÇЩÀàËÆÓÚ
echo()
ºÍ
PHP
´úÂëµÄÊý¾Ý¿éÓÐ×÷Óá£
ÎÒÃÇÏȾÙÒ»¸ö¼òµ¥µÄÀý×Ó£¬Èôó¼Ò¶Ô ......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......
µ¼¶Á£º ¡¡
¡¡Apache: ¡¡
¡¡¿ªÆô httpd.conf£¬¼ÓÈëÒÔÏÂÁ½ÐÐ: ¡¡
¡¡QUOTE: ¡¡
¡¡ServerTokens ProductOnly ¡¡
¡¡ServerSignature Off ¡¡
¡¡PHP: ¡¡
¡¡Òþ²Ø PHP °æ±¾¾ÍÊÇÒþ²Ø "X-Powered-By: PHP/5.1.2-1+b1" Õâ¸ö£¬¿ªÆô php.ini£¬¼ÓÈë: ¡¡
¡¡QUOTE: ¡¡
¡¡expose_php = Off ¡¡
¡¡Apache ½ûֹĿ¼ä¯ÀÀ: ¡¡
¡¡½ûֹĿ ......
×î½üÐÂÂòÁ˸öµçÄÔ£¬ÏµÍ³ÊÇwindows7£¬window7ÔÚ½çÃ棬¹¦ÄÜ·½Ã涼ͦÈÃÈËÂúÒâµÄ£¬¸Ð¾õºÜˬ£¬²»Ë¬µÄÊÇÓÖÒªÖØа²×°»·¾³ÁË¡£
ËùÓÐÈí¼þ¾ù°²×°ÔÚF:\server\ÏÂ
apacheĿ¼£ºF:\server\apache2.2
phpĿ¼£ºF:\server\php
msyqlĿ¼£ºF:\server\mysql
Ò»¡¢°²×°apache
°²×°apacheµÄ°æ±¾ÊÇ£ºhttpd-2.2.15-win32-x86-no_ssl.msi
° ......
CentOSµÄphp°æ±¾Ä¬ÈÏΪ5.1.6£¬È»ºóÔÚ5.2.9°æ±¾Ö®Ç°µÄµÄphp¶¼´æÔÚÒ»¸ö©¶´£¬µ«ÊÇÄ¿Ç°ÍøÉϺܶàµØ·½¶¼ÎÞ·¨Ê¹ÓÃyum update php*Éý¼¶µ½5.2.9£¬±È½Ï³£¼ûµÄÊÇÉý¼¶µ½5.2.6°æ±¾µÄ£¬¾¹ýËÑË÷¹úÍâ×ÊÁÏ£¬ÏÖÔÚÖÕÓÚÕÒµ½Ò»ÖÖÉý¼¶CentOSµÄphpµ½5.2.9µÄ·½·¨¡£
ÔËÐÐÏÂÃæÃüÁ
# wget http://download.fedora.redhat.com/pub/epel/5/i386/ep ......