PHP Îļþ¶Áд²Ù×÷
¡¡¡¡PHP ÖУ¬Êý¾Ýͨ³£¶¼ÊÇ´æ´¢ÔÚMySQLÊý¾Ý¿âµ±Öеġ£µ«ÊÇÓÐЩʱºò£¬ÎÒÃÇ»¹ÊÇÐèҪʹÓÃPHP¶ÁдһЩ±¾µØÎļþ¡£±ÈÈçÉú³É¾²Ì¬Ò³Ãæ»òÕßÊý¾ÝµÄ±¾µØ»º´æ¡£
¡¡¡¡PHP5+ ÌṩÁËÒ»ÖÖ·½·¨ file_put_contents(file,data,mode,context)£¬Ëü½«Ò»¸ö×Ö·û´®Ð´ÈëÎļþ£¬·µ»ØдÈëµ½ÎļþÄÚÊý¾ÝµÄ×Ö½ÚÊý¡£ºÍÒÀ´Îµ÷Óà fopen()£¬fwrite() ÒÔ¼° fclose() ¹¦ÄÜÒ»Ñù£¬·½±ãÁËʹÓá£
²ÎÊýÃèÊö
file
±ØÐè¡£¹æ¶¨ÒªÐ´ÈëÊý¾ÝµÄÎļþ¡£Èç¹ûÎļþ²»´æÔÚ£¬Ôò´´½¨Ò»¸öÐÂÎļþ¡£
data
¿ÉÑ¡¡£¹æ¶¨ÒªÐ´ÈëÎļþµÄÊý¾Ý¡£¿ÉÒÔÊÇ×Ö·û´®¡¢Êý×é»òÊý¾ÝÁ÷¡£
mode
¿ÉÑ¡¡£¹æ¶¨ÈçºÎ´ò¿ª/дÈëÎļþ¡£¿ÉÄܵÄÖµ£º
FILE_USE_INCLUDE_PATH£ºÊ¹Óðüº¬Ä¿Â¼¶¨Òå
FILE_APPEND£º×·¼Ó£¬·ÀÖ¹±»¸ÄдÔÎļþÄÚÈÝ
LOCK_EX£º¶ÀÕ¼Ëø¶¨·½Ê½
Èç¹û²ÎÊýÊ¡ÂÔÔòĬÈÏΪ¸ÄдÎļþ·½Ê½
context
¿ÉÑ¡¡£¹æ¶¨Îļþ¾ä±úµÄ»·¾³¡£
context ÊÇÒ»Ì׿ÉÒÔÐÞ¸ÄÁ÷µÄÐÐΪµÄÑ¡Ïî¡£
¡¡¡¡PHP ²Î¿¼ÊéÖУ¬Ö¸Ã÷Á˶ÁÎļþ·½·¨ file_get_contents µÄ¿ÉÓð汾 (PHP 4 >= 4.3.0, PHP 5)£¬PHP 5 ½øÐÐÁËÀ©Õ¹£¬ 5.0.0 Ìí¼ÓÁË¶Ô context µÄÖ§³Ö¡£ 5.1.0 Ìí¼ÓÁË offset ºÍ maxlen ²ÎÊý¡£
¡¡¡¡¾ßÌåÓ÷¨£ºfile_get_contents ( file , flags , context , offset , maxlen)
²ÎÊýÃèÊö
file
±ØÐè¡£¹æ¶¨ÒªÐ´ÈëÊý¾ÝµÄÎļþ¡£Èç¹ûÎļþ²»´æÔÚ£¬Ôò´´½¨Ò»¸öÐÂÎļþ¡£
flags
¿ÉÑ¡¡£¹æ¶¨ÈçºÎ¶ÁÈ¡Îļþ¡£¿ÉÄܵÄÖµ£º
FILE_USE_INCLUDE_PATH£ºÊ¹Óðüº¬Ä¿Â¼¶¨Òå
FILE_TEXT£ºÎı¾¸ñʽÄÚÈÝ¡£
FILE_BINARY£º½öÓÃÓÚ¶þ½øÖƸñʽ¡£
Èç¹û²ÎÊýÊ¡ÂÔÔòĬÈÏΪFILE_BINARY
context
ÉÏÏÂÎÄ
offset
¿ÉÑ¡¡£Æðʼ¶ÁλÖã¬Æ«ÒÆ¡£
maxlen
¿ÉÑ¡¡£¶ÁÈ볤¶È¡£
¡¡¡¡PHP5ÒÔÏ°汾ÎÒÃÇÓà fopen, fread, fwrite, fclose ½øÐÐÎļþ¶Áд¡£ÏÂÃ渽ÉÏÒ»¶ÎÀý×Ó£º
¡¡¡¡Ã¿µ±ÎÒÃÇ·ÃÎÊ´ËÍøÒ³µÄʱºò£¬»áÏÔʾ³ö·ÃÎʹýµÄIPÒÔ¼°·ÃÎÊʱ¼ä£»Í¬Ê±µ±Ç°µÄ·ÃÎÊÒ²»á±»¼Ç¼£¬ÒÔ±ãÔÚÏ´ηÃÎʵÄʱºò³öÏÖ¡£
<?php
header("Content-Type: text/plain");
$visitorIP = $_SERVER["REMOTE_ADDR"];
$currentTime = date("H:i:s");
if( file_exists("./visitLog.log") ):
$logFileHandle = fopen("./visitLog.log", "r+");
$logFileSize = filesize("./visitLog.log");
$logContent = fread($logFileHandle, $logFileSize);
else:
$logFileHandle = fopen("./visitLog.log", "x+");
$logContent = "\r\tNo more Log";
endif;
echo "Visit Lo
Ïà¹ØÎĵµ£º
Ä¿Ç°LAMP (Linux + Apache + MySQL + PHPspan style="font-family: Verdana;">) ½ü¼¸ÄêÀ´·¢Õ¹Ñ¸ËÙ£¬ÒѾ³ÉΪWeb ·þÎñÆ÷µÄÊÂʵ±ê×¼¡£LAMPÕâ¸ö´ÊµÄÓÉÀ´×îÔçʼÓڵ¹úÔÓÖ¾“c't Mag
azine”£¬Michael KunzeÔÚ1990Äê×îÏÈ°ÑÕâЩÏîÄ¿×éºÏÔÚÒ»Æð´´ÔìÁËLAMPµÄËõд×Ö¡£ÕâЩ×é¼þËäÈ»²¢²»ÊÇ¿ª¿ªÊ¼¾ÍÉè¼ÆΪһÆðʹ ......
Centos ÀïµÄ yum ÔÚÏß°²×°ºÜÂý.ÒÔÏÂÊÇÌ滻ΪÖйúCentOS¾µÏñ·þÎñÆ÷!
Öйú¹Ù·½¾µÏñÍøÕ¾: http://centos.ustc.edu.cn/
/* ʹÓÃ˵Ã÷ */
cd /etc/yum.repos.d[½øÈëyum.repos.dĿ¼]
mv CentOS-Base.repo CentOS-Base.repo.save[ÐÞ¸ÄÔ´ÎļþÃû³Æ±¸·Ý]
wget http://centos.ustc.edu.cn/CentOS-Base.repo.5[ÏÂÔØ]
mv CentOS-Ba ......
phpµÄÅäÖú¯Êý¾ÍÊǼ¸¸öini_*µÄº¯Êý£¬Ö÷ÒªÊÇÕë¶ÔÅäÖÃÎļþµÄ²Ù×÷£¬Æäʵ¾ÍËĸöº¯Êý£ºini_get¡¢ini_set¡¢ini_get_all¡¢ini_restore¡£¸öÈ˸оõ×îÓÐÓõľÍÊÇini_setºÍini_get¡£
* ini_get()£º»ñÈ¡ÅäÖÃÎļþµÄÑ¡ÏîÖµ
Õâ¸öº¯ÊýÏàÐźܶàÈ˶¼Ê¹¹ý£¬¾ÍÊÇ»ñÈ¡ÅäÖÃÎļþÖÐijһ¸öÑ¡ÏîµÄÖµ£¬Èç¹ûÊÇÈ«Ó°È˲ÅÍøtrueÖµ¾Í·µ»Ø1£¬Èç¹ûÊÇfalseÖµ¾ ......
ÔÚwindowsϵÄphp.iniÎļþÀï
ÕÒµ½ÕâÒ»ÐдúÂ루ÈçûÓÐÔò×ÔÐÐÌí¼Ó£©
extension=php_soap.dll
SOAPÔÚphp.iniÖл¹ÓÐ×Ô¼ºµÄÅäÖò¿·Ö£¬ÈçÏÂËùʾ
[soap]
; Enables or disables WSDL caching feature.
soap.wsdl_cache_enabled=1
; Sets the directory name where SOAP extension will put cache files.
soap.wsdl_cache_d ......