Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ :

linux²é¿´ÏµÍ³ÊôÐÔ

linux²é¿´ÏµÍ³ÊôÐÔ
ϵͳ
# uname -a               # ²é¿´ÄÚºË/²Ù×÷ϵͳ/CPUÐÅÏ¢
# head -n 1 /etc/issue   # ²é¿´²Ù×÷ϵͳ°æ±¾
# cat /proc/cpuinfo      # ²é¿´CPUÐÅÏ¢
# hostname               # ²é¿´¼ÆËã»úÃû
# lspci -tv              # ÁгöËùÓÐPCIÉ豸
# lsusb -tv              # ÁгöËùÓÐUSBÉ豸
# lsmod                  # Áгö¼ÓÔصÄÄÚºËÄ£¿é
# env                    # ²é¿´»·¾³±äÁ¿
×ÊÔ´
# free -m                # ²é¿´ÄÚ´æʹÓÃÁ¿ºÍ½»»»ÇøÊ¹Ó ......

²é¿´linuxÓ²¼þÐÅÏ¢

1, Ö÷°åÐÅÏ¢¡¡¡¡.²é¿´Ö÷°åµÄÐòÁкš¡¡¡--------------------------------------------------¡¡¡¡#ʹÓÃÃüÁî¡¡¡¡dmidecode | grep -i 'serial number'¡¡¡¡#²é¿´°å¿¨ÐÅÏ¢¡¡¡¡cat /proc/pci¡¡¡¡------------- ...¡¡¡¡1, Ö÷°åÐÅÏ¢
¡¡¡¡.²é¿´Ö÷°åµÄÐòÁкÅ
¡¡¡¡--------------------------------------------------
¡¡¡¡#ʹÓÃÃüÁî
¡¡¡¡dmidecode | grep -i 'serial number'
¡¡¡¡#²é¿´°å¿¨ÐÅÏ¢
¡¡¡¡cat /proc/pci
¡¡¡¡--------------------------------------------------
¡¡¡¡2, cpuÐÅÏ¢
¡¡¡¡--------------------------------------------------
¡¡¡¡#ͨ¹ý/procÎļþϵͳ
¡¡¡¡1) cat /proc/cpuinfo
¡¡¡¡#ͨ¹ý²é¿´¿ª»úÐÅÏ¢
¡¡¡¡2) dmesg | grep -i 'cpu'
¡¡¡¡#
¡¡¡¡3)dmidecode -t processor
¡¡¡¡--------------------------------------------------
¡¡¡¡3, Ó²ÅÌÐÅÏ¢
¡¡¡¡--------------------------------------------------
¡¡¡¡#²é¿´·ÖÇøÇé¿ö
¡¡¡¡fdisk -l
¡¡¡¡#²é¿´´óСÇé¿ö
¡¡¡¡df -h
¡¡¡¡#²é¿´Ê¹ÓÃÇé¿ö
¡¡¡¡du -h
¡¡¡¡#
¡¡¡¡hdparm -I /dev/sda
¡¡¡¡#
¡¡¡¡dmesg | grep sda
¡¡¡¡--------------------------------------------------
¡¡¡¡4, ÄÚ´æ ......

¹ØÓÚNginx+PHPµÄÐéÄâÖ÷»úĿ¼ȨÏÞ¿ØÖƵÄ̽¾¿

NginxµÄʹÓÃÕß×î½üÔ½À´Ô½¶à£¬ºÜ¶à´óÐÍÍøÕ¾Ò²¶¼´ÓApache»òÆäËûƽ̨ǨÒƵ½ÁËNginx¡£µ«ÔÚÎÒʹÓÃNginxµÄ¹ý³ÌÖÐÓиöÎÊÌâһֱδµÃµ½½â¾ö£¬¾ÍÊÇÈçºÎÏÞÖÆNginx+PHPµÄĿ¼ȨÏÞ
ÎÒÃÇÖªµÀ£¬ÔÚApacheÖпÉÒÔºÜÈÝÒ׵ĶÔÐéÄâĿ¼½øÐÐȨÏÞ¿ØÖÆ£¬È磺
<VirtualHost www.xpb.cn>
    ServerAdmin xiaopb@live.com
    DocumentRoot /usr/www/xpb/
    ServerName www.xpb.cn:80
    ServerAlias www.xpb.cn
    ErrorLog logs/default-error_log
    php_admin_value open_basedir "/tmp/:/usr/www/xpb/"
</VirtualHost>
¹Ø¼üÊǺóÃæµÄÕâ¾äphp_admin_value£¬ÕâÑù¾ÍÏÞÖÆÁËphpµÄ²Ù×÷Ŀ¼½öÏÞÓÚ/tmp/ºÍ/usr/www/xpb/ÕâÁ½¸öĿ¼ÁË¡£¶ÔÓÚ ApacheÐéÄâÖ÷»úÀ´Ëµ£¬Õâ¸öÉèÖÃÊ®·ÖÓÐÓ㬽áºÏÔÚphp.iniÖнûÓÃһЩphpº¯Êý£¬¼¸ºõ¿ÉÒԶžøPHPľÂí¶ÔÆäËûÕ¾µã¼°ÏµÍ³µÄΣº¦¡£ÎÒËäûרҵ×ö¹ýLinuxϵÄÐéÄâÖ÷»ú£¬µ«ÏàП÷´óÐéÄâÖ÷»úÉÌÒ²ÊÇÕâô×öµÄ¡£
    ¿´À´¶ÔÓÚApache×îºÃµÄ°ì·¨»¹ÊÇʹÓÓÔÚph ......

PHP DATE( )º¯ÊýÓëϵͳʱ¼ä²î8Сʱ½â¾ö°ì·¨

Ò»£¬Ô­Òò
´Óphp5.1.0¿ªÊ¼£¬php.iniÀï¼ÓÁËdate.timezoneÕâ¸öÑ¡Ï²¢ÇÒĬÈÏÇé¿öÏÂÊǹرյÄ
Ò²¾ÍÊÇÏÔʾµÄʱ¼ä£¨ÎÞÂÛÓÃʲôphpÃüÁ¶¼ÊǸñÁÖÍþÖαê׼ʱ¼ä
ºÍÎÒÃǵÄʱ¼ä£¨±±¾©Ê±¼ä£©²îÁËÕýºÃ8¸öСʱ¡£
¶þ£¬½â¾ö°ì·¨
·½·¨Ò»£ºÔÚ»ñȡʱ¼äÇ°¼ÓÈçÏ´úÂ룺
date_default_timezone_set(PRC);
·½·¨¶þ£º¸Äphp.iniÀïÃæµÄÅäÖÆ£¬¾ßÌå²Ù×÷ÈçÏ£º
´ò¿ªphp.ini²éÕÒdate.timezone È¥µôÇ°ÃæµÄ·ÖºÅ= ºóÃæ¼ÓXXX(PRC)£¬ÖØÆôhttp·þÎñ£¨Èçapache2»òiisµÈ£©¼´¿É
È磺date.timezone=PRC
¹ØÓÚXXX£¬´ó½ÄڵؿÉÓõÄÖµÊÇ£ºAsia/Chongqing £¬Asia/Shanghai £¬Asia/Urumqi £¬PRC£¨ÒÀ´ÎΪÖØÇ죬ÉϺ££¬ÎÚ³ľÆ룬ÖлªÈËÃñ¹²ºÍ¹ú£©
¸Ų̂µØÇø¿ÉÓãºAsia/Macao £¬Asia/Hong_Kong £¬Asia/Taipei £¨ÒÀ´ÎΪ°ÄÃÅ£¬Ïã¸Û£¬Ì¨±±£©
»¹ÓÐмÓÆ£ºAsia/Singapore
ÆäËü£ºEtc/GMT-8 £¬Singapore £¬Hongkong
·½·¨Èý£ºecho date("Y-m-d H:i:s", time()+8*60*60);
¸½£ºdateʱ¼ä¸ñʽ
date("Y-m-d H:i:s"); ÏÔʾµÄ¸ñʽ: Äê-ÔÂ-ÈÕ Ð¡Ê±:·ÖÖÓ:Ãë
Ïà¹Øʱ¼ä²ÎÊý:
a - "am" »òÊÇ "pm"
A - "AM" »òÊÇ "PM"
d - ¼¸ÈÕ£¬¶þλÊý×Ö£¬Èô²»×ã¶þλÔòÇ°Ãæ²¹Áã; È ......

phpÖо­³£Óõ½µÄ¼¸¸öÈ¡Õûº¯Êý


¾­³£Óõ½È¡ÕûµÄº¯Êý£¬½ñÌìССµÄ×ܽáһϣ¡ÆäʵºÜ¼òµ¥£¬¾ÍÊǼ¸¸ö
º¯Êý¶øÒÑ¡«¡«Ö÷ÒªÊÇ£ºceil£¬floor£¬round£¬intval
ceil -- ½øÒ»·¨È¡Õû
˵Ã÷
float ceil ( float value )
·µ»Ø²»Ð¡ÓÚ value µÄÏÂÒ»¸öÕûÊý£¬value Èç¹ûÓÐСÊý²¿·ÖÔò½øһλ¡£ceil() ·µ»ØµÄÀàÐÍÈÔÈ»ÊÇ float£¬ÒòΪ float ÖµµÄ·¶Î§Í¨³£±È integer Òª´ó¡£ 
Àý×Ó 1. ceil() Àý×Ó
<?php
echo ceil(4.3);     // 5
echo ceil(9.999);     // 10
?>  
floor -- ÉáÈ¥·¨È¡Õû
˵Ã÷
float floor ( float value )
·µ»Ø²»´óÓÚ value µÄÏÂÒ»¸öÕûÊý£¬½« value µÄСÊý²¿·ÖÉáȥȡÕû¡£floor() ·µ»ØµÄÀàÐÍÈÔÈ»ÊÇ float£¬ÒòΪ float ÖµµÄ·¶Î§Í¨³£±È integer Òª´ó¡£ 
Àý×Ó 1. floor() Àý×Ó
<?php
echo floor(4.3);     // 4
echo floor(9.999); //&nb ......

PHP±à³ÌÖÐÎÊÌ⼯½õ

1. Win32ÏÂapache2ÓÃget·½·¨´«µÝÖÐÎIJÎÊý»á³ö´í
test.php?a=ÄãºÃ&b=ÄãÒ²ºÃ
´«µÝ²ÎÊýÊǻᵼÖÂÒ»¸öÄÚ²¿´íÎó
½â¾ö°ì·¨:"test.php?a=".urlencode(ÄãºÃ)."&b=".urlencode(ÄãÒ²ºÃ)
2. win32ϵÄsession²»ÄÜÕý³£¹¤×÷
php.iniĬÈϵÄsession.save_path = /tmp ÕâÏÔÈ»ÊÇlinuxϵÄÅäÖã¬win32ÏÂphpÎÞ·¨¶ÁдsessionÎļþµ¼ÖÂsessionÎÞ·¨Ê¹Ó㬰ÑËü¸Ä³ÉÒ»¸ö¾ø¶Ô·¾¶¾Í¿ÉÒÔÁË£¬
ÀýÈçsession.save_path = c:\windows\temp
3. includeºÍrequireµÄÇø±ð
Á½
ÕßûÓÐÌ«´óµÄÇø±ð£¬Èç¹ûÒª°üº¬µÄÎļþ²»´æÔÚ£¬
includeÌáʾnotice£¬È»ºó¼ÌÐøÖ´ÐÐÏÂÃæµÄÓï¾ä£¬requireÌáʾÖÂÃü´íÎó²¢ÇÒÍ˳ö£¬¾ÝÎÒ²âÊÔ£¬win32ƽ̨ÏÂËüÃǶ¼ÊÇÏÈ°üº¬ºóÖ´ÐУ¬ËùÒÔ
±»°üº¬ÎļþÀï×îºÃ²»ÒªÔÙÓÐinclude»òrequireÓï¾ä£¬ÕâÑù»áÔì³ÉĿ¼»ìÂÒ¡£
4. isset()ºÍempty()µÄÇø±ð
Á½
Õ߶¼ÊDzâÊÔ±äÁ¿Óõġ£µ«ÊÇ
isset()ÊDzâÊÔ±äÁ¿ÊÇ·ñ±»¸³Öµ£¬¶øempty()ÊDzâÊÔÒ»¸öÒѾ­±»¸³ÖµµÄ±äÁ¿ÊÇ·ñΪ¿Õ¡£Èç¹ûÒ»¸ö±äÁ¿Ã»±»¸³Öµ¾ÍÒýÓÃÔÚphpÀïÊDZ»ÔÊÐíµÄ,µ«»áÓÐ
noticeÌáʾ¡£Èç¹ûÒ»¸ö±äÁ¿±»¸³¿ÕÖµ£¬$foo=""»òÕß$foo=0»òÕß
$foo=false,ÄÇôempty($foo)·µ»ØÕ棬isset($foo)Ò²·µ»ØÕ棬¾ÍÊÇ˵¸³¿ÕÖµ²»»á×¢Ïú ......
×ܼǼÊý:40319; ×ÜÒ³Êý:6720; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [6711] [6712] [6713] [6714] [6715] [6716] 6717 [6718] [6719] [6720]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ