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

Apache 2 and PHP 5 (mod_php) on Linux


Apache 2 and PHP Installation
The following notes are how I got Apache 2 and PHP 5 (or PHP 4) working together on Linux. These instructions also apply, mostly, for any UNIX-like system, especially other Linux distributions. If you have a recent Linux distribution (say since 2002), you already have Apache 2 and PHP, so you don't need to do this unless you want the latest Apache 2 or PHP release or need to customize the Apache or PHP software. Don't forget to remove (or at least disable) the Apache rpm package if you install your own custom Apache.
Apache 2 Version Tip: Beginning with Apache 2.0.42 the API will be kept stable (yeah!). That means you will NOT have to recompile modules (and possibly upgrade/fix source) every time you install a new Apache release. This assumes you stay in the same Apache release series. For example, upgrading from 2.2.0 to 2.2.2 should work. This will not apply to upgrading to the next series (e.g., "development" 2.3.x or "stable" 2.4.x).
I was only able to get PHP working with Apache 2 as a *.so DSO ("dynamic shared object"), as opposed to compiled into Apache (with a static *.a library). I think DSO is the only way PHP is supported now on Apache 2.
I first used httpd-2.0.43 and php-4.3.0 with RedHat 7.3. I am now using httpd-2.2.3 and php-5.2.0 with SUSE 10.1.
Note: If you have problems with PHP and think it's a recent bug, you may want to consider using the latest http://snaps.php.net/ snapshot. Beware that snapshots frequently have regression and are not for production use. Usually problems are because of mis-configuration, not bugs, so snapshots will probably hurt more than help.
Download/unpack Apache2 source from the Apache httpd server website, http://httpd.apache.org/ 
In the Apache 2 source directory, create a Makefile by typing:
./configure --prefix=/usr/local/apache \
--enable-so \
--enable-cgi \
--enable-info \
--enable-rewrite \
--enable-speling \
--ena


Ïà¹ØÎĵµ£º

¹ØÓÚPHPÄã¿ÉÄܲ»ÖªµÀµÄ10¼þÊÂ

С±àÖ®Ç°Ò²Ôø±¨µ¼¹ýPHP¿ª·¢ÈËÔ±ÈÝÒ׺öÂԵļ¸µã¾«»ª,³ýÁËһЩ¾«»ª¼¼Êõ·½·¨Í⣬ºÜ¶àϸ΢֮´¦Ò²ÊdzÌÐòÔ±
ÃÇÈÝÒ׺öÂԵģ¬ÏÂÃæÎÒÃÇΪÄú×ܽáÁË10¸ö¹ØÓÚPHPÄã¿ÉÄܲ»ÖªµÀµÄÊÂÇé¡£
¡¡¡¡¹ØÓÚPHP¸ü¶àÄÚÈÝ£¬»¶Ó­·ÃÎÊ£ºPHP¿ª·¢»ù´¡ÈëÃÅ
¡¡¡¡1.ʹÓÃip2long() ºÍlong2ip()º¯ÊýÀ´°ÑIPµØÖ·×ª»¯³ÉÕûÐÍ´æ´¢µ½Êý¾Ý¿âÀï¡£
¡¡¡¡ÕâÖÖ·½·¨°Ñ´æ´¢ ......

PHP ÅÅÐòËã·¨½âÎö

<?
//²åÈëÅÅÐò£¨Ò»Î¬Êý×飩
function insert_sort($arr){
¡¡$count = count($arr);
¡¡for($i=1; $i<$count; $i++){
¡¡¡¡$tmp = $arr[$i];
¡¡¡¡$j = $i - 1;
¡¡¡¡while($arr[$j] > $tmp){
¡¡¡¡¡¡$arr[$j+1] = $arr[$j];
¡¡¡¡¡¡$arr[$j] = $tmp;
¡¡¡¡¡¡$j--;
¡¡¡¡}
¡¡}
¡¡return $arr;
}
¡¡¡¡
//Ñ¡Ô ......

PHP³£ÓÃÕýÔò±í´ïʽ

    Æ¥ÅäÖÐÎÄ×Ö·ûµÄÕýÔò±í´ïʽ
£º [\u4e00-\u9fa5]
    Æ¥ÅäË«×Ö½Ú×Ö·û(°üÀ¨ºº×ÖÔÚÄÚ)
£º ["\x00-\xff]
    Ó¦Ó㺼ÆËã×Ö·û´®µÄ³¤¶È
£¨Ò»¸öË«×Ö½Ú×Ö·û³¤¶È¼Æ2£¬ASCII×Ö·û¼Æ1£©
    String.prototype.len=function(){return
th ......

PHPÎÞÏÞ·ÖÀàµÄ¾ßÌåÔ­Àí·ÖÎö

¡¡¡¡¶ÔÓÚ³õѧPHPÓïÑÔµÄÅóÓÑÀ´Ëµ£¬PHP»¹ÓкܶණÎ÷ÐèÒªÉîÈëµÄ̽¾¿¡£Ö»ÓÐÔÚ²»¶ÏµÄÎÊÌâ´¦ÀíÖвÅÄÜÕÆÎÕÆäÖеÄÕæÖ¿¡£Ê²Ã´ÊÇPHPÎÞÏÞ·ÖÀàÄØ?¾ÍÏñwindowsÏÂн¨Ò»¸öÎļþ¼Ð£¬ÔÚн¨µÄÎļþ¼ÐÏÂÓÖ¿ÉÒÔн¨Ò»¸öÎļþ¼Ð£¬ÕâÑùÎÞÏÞÑ­»·ÏÂÈ¥£¬ÎÞÏÞ·ÖÀàÒ²ÊÇÕâÑù£¬¸¸Àà¿ÉÒÔ·Ö³öËü×ÓÀ࣬×ÓÀàÓÖ¿ÉÒÔ·Ö³öËüµÄ×ÓÀ࣬ÕâÑùÒ»Ö±ÎÞÏÞÑ­»·ÏÂÈ¥¡£
¡¡¡¡Ä ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ