Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

phpº¯Êý getenv()Óëputenv()ºÍ$_SERVER

[ת×Ô]http://hi.baidu.com/heiday/blog/item/ce3217006b10c0df277fb5b1.html
phpº¯Êý getenv()Óëputenv()ºÍ$_SERVER
2009-07-09 15:03
getenv È¡µÃϵͳµÄ»·¾³±äÁ¿
Óï·¨£ºstring getenv(string varname);-----------²ÎÊývarnameÓ¦¸ÃÊÇ$_SERVER£¨·þÎñÆ÷³¬¼¶È«¾Ö±äÁ¿Êý×飩ÖÐÔ¤¶¨µÄÔªËØË÷ÒýÃû¡¢»òÕßÊÇÓÃputenv("new=very new")¶¨ÒåÒ»ÏÂnewΪ»·¾³±äÁ¿£¬ËùÒÔnew×÷Ϊ²ÎÊý½«µÃÖµvery new
·µ»ØÖµ£º×Ö·û´® 
º¯ÊýÖÖÀࣺPHP ϵͳ¹¦ÄÜ
ÄÚÈÝ˵Ã÷£ºÈôÕýÈ·È¡µÃ»·¾³±äÁ¿ varname£¬Ôò·µ»Ø±äÁ¿Öµ¡£Ê§°ÜÔò·µ»Ø false¡£
ʹÓ÷¶Àý
ÏÂÀý¿ÉÒÔÈ¡µÃÓû§ä¯ÀÀÆ÷ËùÔÚ»úÆ÷µÄÍøÖ·
<?
$ip = getenv(“REMOTE_ADDR”);
?>
$_SERVERÊÇ·þÎñÆ÷³¬¼¶È«¾Ö±äÁ¿Êý×é ÓÃ$_SERVER['REMOTE_ADDR']ͬÑù¿ÉÒÔ»ñÈ¡µ½¿Í»§¶ËµÄIPµØÖ·¡£
¶þÕßµÄÇø±ðÔÚÓÚ£¬getenv²»Ö§³ÖIISµÄisapi·½Ê½ÔËÐеÄphp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
putenv ÅäÖÃϵͳ»·¾³±äÁ¿
PHP putenv()Óï·¨£ºvoid putenv(string setting);
·µ»ØÖµ£ºÎÞ
º¯ÊýÖÖÀࣺPHP ϵͳ¹¦ÄÜ
ÄÚÈÝ˵Ã÷£º±¾º¯ÊýÓÃÀ´ÅäÖÃϵͳ»·¾³±äÁ¿¡£
ʹÓ÷¶Àý£º
ÅäÖà Oracle Êý¾Ý¿âÐèʹÓõĻ·¾³±äÁ¿ NLS_LANG£¬·µ»Ø×ÊÁϺ¬ÖÐÎÄ BIG5 Âë¡£
<?
putenv("NLS_LANG=american_taiwan.zht16big5");
?>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
putenv()Óëgetenv()×ÛºÏʾÀý
<?php
putenv("new=very new");
$is_new = getenv("new");
$new="bu shi";
echo $is_new,"<br />",$new;
?>
Êä³ö£º
very new
ËùÒÔ´ÓÉÏ¿ÉÒÔÖªµÀ²»ÓÃÅÂÔÚÎÒÃǵĴúÂëÀﶨÒåÓëputenv¶¨ÒåµÄ»·¾³±äÁ¿Í¬Ãû£¬Ïñ´ËÀýÖÐputenv("new=very new");     Óë    $new="bu shi";      -----newÒ»ÑùÁËÒ²²»³ö´í¡£
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PHP·þÎñÆ÷±äÁ¿$_SERVERÏê½â£º
£¨ÒÔÏÂתÔØ×԰ٶȿռä“Õä°®ÉúÃü£¬Ô¶Àëó¦Ð·”£©Ô­ÎĵØÖ·£ºhttp://hi.baidu.com/sungoogle/blog/item/015d19305180869ba8018e68.html
Õä°®ÉúÃü£¬Ô¶Àëó¦Ð·
°®Éú»î£¬°®¹È¸è£»Ç¿ÁÒÇ´Ôð¶ÔgoogleµÄÎÞÀí·âɱ£¡
AD-->PHP/ASP¼¼ÊõÌÖÂÛȺ£¬ÈººÅ£º6092740
½ñÌì×ÐϸѧϰÁËÒ»ÏÂÊÖ²á¹ØÓÚ·þÎñÆ÷±äÁ¿µÄÄÚÈÝ£¬Ð´¸öÒ»¸ö±Ê¼Ç


Ïà¹ØÎĵµ£º

LAMP(Linux+Apache+MySQL+PHP)·þÎñÆ÷µÄÐÔÄÜÓÅ»¯

Ä¿Ç°LAMP (Linux + Apache + MySQL + PHPspan style="font-family: Verdana;">) ½ü¼¸ÄêÀ´·¢Õ¹Ñ¸ËÙ£¬ÒѾ­³ÉΪWeb ·þÎñÆ÷µÄÊÂʵ±ê×¼¡£LAMPÕâ¸ö´ÊµÄÓÉÀ´×îÔçʼÓڵ¹úÔÓÖ¾“c't Mag
 
azine”£¬Michael KunzeÔÚ1990Äê×îÏÈ°ÑÕâЩÏîÄ¿×éºÏÔÚÒ»Æð´´ÔìÁËLAMPµÄËõд×Ö¡£ÕâЩ×é¼þËäÈ»²¢²»ÊÇ¿ª¿ªÊ¼¾ÍÉè¼ÆΪһÆðʹ ......

³£Óà PHP CMS ϵͳ

PhpArtile
¹Ù·½£ºhttp://www.21ds.net/
Õâ¸öËãÊǹúÄÚphpCmsµÄ×æ×ÚÁË£¬PAÓÉ PHP ÓïÑÔ¿ª·¢, ʹÓà MySQL Êý¾Ý¿â±£´æÊý¾Ý ,ΪÖÐСÐÍÍøÕ¾·¢±íÎÄÕÂ, ´æ·Å×ÊÁÏ, ÐÂÎÅ·¢²¼Ìṩһ¸öÍêÃÀµÄ½â¾ö·½°¸¡£
×öÁ˺ü¸ÄêÁË£¬3.0³Ù³Ù»¹ÔÚ¿ª·¢ÖУ¬½ñÄê³öÁË2.1»ðÁËÒ»Õó£¬ÓÖϨÃðÁË£¬ÒÔÇ°ÓõÄÈËͦ¶àµÄ£¬ÏÖÔÚ»ù±¾ÉÏûÂäÁË¡£
......

1·ÖÖÓÍêÃÀ°²×°×îРCentOS + Nginx + PHP FPM + MySQL


PHP 5.3.1
MySQL 5.0.89
Nginx 0.8.33 »ò 0.7.65 £¨¿ÉÑ¡£©
ÏÖÔÚ£¬ÎÒÃÇ¿ÉÒÔ¿ìËÙÈ«×Ô¶¯¸ã¶¨ CentOS + Nginx + PHP-FPM + MySQL µÄ°²×°ÁË
Õâ¸ö¿É±ÈÍøÉÏÁ÷´«µÄʲôһ¼ü°²×°°üÒªºÃµÃ¶à£¬Ç¿ÁÒÍƼö´Ë·¨°²×°£¬ÊʺÏËùÓвËÄñºÍ¸ßÊÖ
ÎÒ·þÎñÆ÷ÉÏÈ«ÓõÄÔ´ ......

LinuxÏÂApache 2.2, MySQL 5.0ºÍPHP 5.0µÄ°²×°ÓëÅäÖÃ

¡¾×ª¡¿http://www.linuxsir.org/main/?q=node/241
1.°²×°»·¾³
²Ù×÷ϵͳ£ºRed Hat Linux Enterprise AS 4.0
Êý¾Ý¿â£ºMySQL 5.0.24
Web·þÎñÆ÷£ºApache 2.2.3
½Å±¾ÓïÑÔ£ºPHP 5.1.6
2.°²×°MySQL 5.0.24
-------------ÏÂÔØÈí¼þ°ümysql-5.0.24.tar.gz£¬µØÖ·http://www.mysql.com-------------
# tar zvxf mysql-5.0.24.ta ......

PHPÈýÖÖ³£Óÿò¼ÜZend¡¢symfony ºÍ CakePHP

Ä£ÐÍ¿ò¼Ü
¿ò¼Ü˼Ïë¾ÍÊÇÌṩһÖÖ¿ÉÒÔÔÚ¶à¸öÓ¦ÓóÌÐòÖÐʹÓõÄÉè¼Æ¡£ËùÓÐÓ¦ÓóÌÐò¶¼ÓдóÁ¿Í¨ÓõĻù±¾ÄÚÈÝ —— ¾ßÌåµØ˵£¬¾ÍÊÇijÀàÓëÊý¾Ý¿âµÄ½Ó¿Ú¡¢Ä³Ð©Ó¦ÓóÌÐòÂß¼­¡¢Ó¦ÓóÌÐò³ÊÏÖ¸øÓû§µÄÄÚÈݵȡ£Èç¹ûÄú±àд¹ýÐí¶à PHP Ó¦ÓóÌÐò£¬Ôò»áÖªµÀÕâЩ»ù±¾ÄÚÈÝÊÇʲô¡£Äú¿ÉÄÜÒѾ­±àд¹ýÒ»×麯Êý»ò´ÓÊý¾Ý¿âÖжÁÈ¡Êý¾ÝºÍÏòÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ