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

¿ìËÙ¿ª·¢Ò»¸öPHPÀ©Õ¹

 ¿ìËÙ¿ª·¢Ò»¸öPHPÀ©Õ¹
 
±¾ÎÄͨ¹ý·Ç³£¿ìËٵķ½Ê½½²½âÁËÈçºÎÖÆ×÷Ò»¸öPHP 5.2 »·¾³µÄÀ©Õ¹£¨PHP Extension£©£¬Ï£ÍûÄܹ»ÔÚͼÎĵķ½Ê½ÏÂÈÃÏë¿ìËÙѧϰµÄÅóÓÑÁ˽âÒ»ÏÂÖÆ×÷¹ý³Ì¡£
ÐèÇ󣺱ÈÈ翪·¢Ò»¸ö½Ð×ö heiyeluren  µÄÀ©Õ¹£¬À©Õ¹Àï¾ÍÒ»¸öº¯Êý heiyeluren_test()£¬ÊäÈëÒ»¸ö×Ö·û´®£¬º¯Êý·µ»Ø£ºYour input string: xxxxx¡£
ÒªÇó£ºÁ˽âC/C++±à³Ì£¬ÊìϤPHP±à³Ì
»·¾³£ºÏÂÔØÒ»·Ýphp¶ÔÓ¦°æ±¾µÄÔ´Â룬ÎÒÕâÀïÊÇ php-5.2.6£¬ÏÈÕý³£°²×°php£¬¼ÙÉèÎÒÃǵÄphp°²×°ÔÚ /usr/local/php Ŀ¼£¬Ô´ÂëÔÚ /root/soft/php/php-5.2.6/£¬ÏÖÔÚ¿ªÊ¼£¡
²½ÖèÒ»£ºÉú³ÉÀ©Õ¹¿ò¼Ü
cd /root/soft/php/php-5.2.6/ext
./ext_skel --extname=heiyeluren
cd /root/soft/php/php-5.2.6/ext/heiyeluren
vi config.m4
´ò¿ªÎļþºóÈ¥µô dnl £¬»ñµÃÏÂÃæµÄÐÅÏ¢£º
PHP_ARG_ENABLE(heiyeluren, whether to enable heiyeluren support,
[  --enable-heiyeluren           Enable heiyeluren support])
±£´æÍ˳ö.
(ͼ01)
 
µÚ¶þ²½£º±àд´úÂë
vi php_heiyeluren.h
ÕÒµ½£ºPHP_FUNCTION(confirm_heiyeluren_compiled); £¬ÐÂÔöÒ»ÐУº
PHP_FUNCTION(heiyeluren_test);
±£´æÍ˳ö¡£
(ͼ02)
vi heiyeluren.c
Êý×éÀïÔö¼ÓÎÒÃǵĺ¯Êý£¬ÕÒµ½ zend_function_entry heiyeluren_functions[]£¬Ôö¼Ó£º
PHP_FE(heiyeluren, NULL)
(ͼ03)
ÔÙµ½ heiyeluren.c Îļþ×îºóÃæÔö¼ÓÈçÏ´úÂ룺
PHP_FUNCTION(heiyeluren_test)
{
    char *arg = NULL;
    int arg_len, len;
    char *strg;
    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &arg, &arg_len) == FAILURE) {
        return;
    }
    len = spprintf(&strg, 0, "Your input string: %s\n", arg);
    RETURN_STRINGL(strg, len, 0);
}
±£´æÍ˳ö¡£
(ͼ04)
µÚÈý²½£º±àÒë°²×°
cd /root/soft/php/php-5.2.6/ext/heiyeluren
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make test
make install
ÏÖÔÚ¿´¿´ÊDz»ÊÇÓиö /usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/heiyeluren.so
±à¼­php.ini£¬°Ñ


Ïà¹ØÎĵµ£º

PHP »ù´¡ ÃæÊÔÌâ ÔÓÂÒ

»ù´¡Ìâ
¡¡¡¡1.±íµ¥ÖÐ getÓëpostÌá½»·½·¨µÄÇø±ð?
¡¡¡¡´ð£ºgetÓû§¶Ë½«Êý¾Ý¼Óµ½URLºó£¬¸ñʽΪ”?×Ö¶Î1=ÊäÈëÊý¾Ý1&×Ö¶Î2=ÊäÈëÊý¾Ý2&..."¡£
¡¡¡¡ÓÉÓÚgetÌá½»²ÎÊýºó»áÔÚµØÖ·À¸ÖÐÏÔʾ³öÀ´£¬ËùÒÔ»á²úÉúÑÏÖØµÄ°²È«ÎÊÌâ¡£
¡¡¡¡get´«ÊäµÄÊý¾ÝÁ¿Ð¡£¬get´«ÊäµÄÊý¾ÝÁ¿Ð¡£¬ÕâÖ÷ÒªÊÇÒòΪÊÜurl³¤¶ÈÏÞÖÆ;¶øpost¿ÉÒÔ´«Ê ......

PHP һЩӦ¸ÃÖªµÀµÄÊÂÇé

PHPÔËÐйý³Ì
¼òµ¥µãµÄ
ä¯ÀÀÆ÷ -> web·þÎñÆ÷ -> php½âÊÍÆ÷ -> mysql·þÎñÆ÷ -> php½âÊÍÆ÷ -> web·þÎñÆ÷ -> ä¯ÀÀÆ÷
´ó¼ÒÎÕ¼¸¸öÊÖ
¸´ÔÓµãµÄ ä¯ÀÀÆ÷ -----------------------------> web·þÎñÆ÷-> php½âÊÍÆ÷ -> mysql·þÎñÆ÷ ….
PHPÔËÐлúÖÆ
2009-10-20 ......

PHP 6½«È«ÃæÖ§³ÖUnicodeºÍ¹ú¼Ê»¯

 PHPChinaѶ£ºPHPºËÐÄ¿ª·¢ÕßAndrei ZmievskiÔÚ×î½ü¾ÙÐеÄ2009 Zend/PHP»áÒéµÄÖ÷Ìâ·¢ÑÔÖÐÌá³ö£º“ÔÚ½ÓÏÂÀ´µÄPHP6ÖØÒªÉý¼¶ÖУ¬½«Í¨¹ýÖ§³ÖUnicodeÀ´°ïÖú¿ª·¢ÕßÃÇд³öÄܹ»²¿Êðµ½¶à¸ö²»Í¬ÓïÑÔÊг¡µÄÓ¦ÓóÌÐò¡£”
¡¡¡¡ÉÌÒµ¿ª·¢ÖÐÈç¹ûÖ»ÊÇ¿ª·¢ÎªÌØÓïÑÔÊг¡µÄÓ¦ÓóÌÐò£¬¾Í»áʧȥÆäËûµØ·½µÄÉÌÒµ»ú»á¡£ÔçÔÚ2006Äê4Ô£ ......

PHPÊý¾Ý¿âµÄ²Ù×÷


1. ½¨Á¢ºÍ¹Ø±ÕÁ¬½Ó
1) mysql_connect()
    resource mysql_connect([string hostname [:port][:/path/to/socket][,string username] [,string password]])
    ËùÓвÎÊý¶¼ÊÇ¿ÉÑ¡µÄ
    ¾ÙÀý:
    @mysql_connect("localhost", "user", "password")
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ