linuxÏÂ php5.3.2 µ÷ÓÃ so
php ͨÓõĵ÷Óà soµÄ·½·¨ÊÇʹÓÃdl()º¯Êý£¬µ«ÊÇÔÚphp5.3Ö®ºó²»ÔÙÖ§³ÖÕâÖÖ·½·¨£¬½öÖ§³Ö¾²Ì¬µ÷Óã¬Ê¹ÓÃdl() ¶¯Ì¬µ÷Óõķ½·¨¼û£º
ÒýÓÃÒ³1: http://tech.idv2.com/2007/07/06/use-local-so-in-php/
¸ÐлÔ×÷ÕßÌṩµÄÇåÎúÃ÷Á˵ķ½·¨£¬µ«ÊÇÎÒÔÚ5.3.1°æ±¾iÖÐûÓÐͨ¹ý£¬ÓÚÊÇÎÒÕÒµ½ÁËÒ³Ã棺
ÒýÓÃÒ³2: http://www.9php.com/FAQ/cxsjl/php/2007/11/9405479103083.html
´ËÒ³ÃæÖÐÓÐÌÖÂÛµ½ÈçºÎ¾²Ì¬µ÷ÓÃsoÎļþÖеĺ¯ÊýµÄÃèÊö£¬½â¾ö·½·¨ÈçÏ£º
»·¾³:Apache 2.2.9
php5.3.2
Ê×ÏÈʹÓÃÒýÓÃÒ³1ÌṩµÄ·½·¨Éú³É¶¯Ì¬¿â libhello.so.
½øÈëphp °²×°°ü½âѹËõĿ¼
-laptop:~/dev/software/php-5.3.2$cd ext
funny@funny-laptop:~/dev/software/php-5.3.2/ext$
½¨Á¢Öмä phpÁ´½ÓsoÏîÄ¿cltest
funny@funny-laptop:~/dev/software/php-5.3.2/ext$ ./ext_skel --extname=cltest
Creating directory cltest
Creating basic files: config.m4 config.w32 .cvsignore cltest.c php_cltest.h CREDITS EXPERIMENTAL tests/001.phpt cltest.php [done].
To use your new extension, you will have to execute the following steps:
1. $ cd ..
2. $ vi ext/cltest/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-cltest
5. $ make
6. $ ./php -f ext/cltest/cltest.php
7. $ vi ext/cltest/cltest.c
8. $ make
Repeat steps 3-6 until you are satisfied with ext/cltest/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary.
ÐÞ¸Ä ÅäÖÃÎļþconfig.m4
funny@funny-laptop:~/dev/software/php-5.3.2/ext$ vi cltest/config.m4
ɾ³ý 3 ¸ö dnl
dnl PHP_ARG_WITH(my_module, for my_module support,
dnl Make sure that the comment is aligned:
dnl [ --with-my_module Include my_module support])
»òÕßɾ³ý ϱßÕâ3¸ö dnl
dnl PHP_ARG_ENABLE(my_module, whether to enable my_module support,
dnl Make sure that the comment is aligned:
dnl [ --enable-my_module Enable my_module support])
ÐÞ¸ÄÍê±Ï¡£
ÔÚcltest.cÀ©Õ¹Ä£¿éµÄÖ÷³ÌÐòÎļþÖмÓPHPµÄº¯Êý¶¨Òå
Ö÷³ÌÐòÖÐÃèÊ
Ïà¹ØÎĵµ£º
ÈýÄêǰתÓïÑÔ×öÁËJ2ee£¬½ñÌìÎÒÓֻص½µÄԵ㡣ÈýÄêÇ°ÎÒÓÃPHPµÄ¿ª·¢ÍøÕ¾µÄ·½Ê½½øÈëÁËÈí¼þÕâ¸öÐÐÒµ£¬Ã»Ïëµ½ÏÖÔÚÎÒÓÖ»ØÀ´ÁË£¬ÕõÔú×ÅÍ´¿àµÄ»ØÀ´ÁË¡£
½«À´µÄÈí¼þ¿ª·¢ºÍ¹ÜÀíÎÒ½«×¨×¢ÓÚ»¥ÁªÍø¼¼ÊõµÄ·¢Õ¹¡£
ÀÎɧ·¢ÍêÁË¡£ÏÖÔÚÈÃÎÒÀ´¼Ç¼һÏÂÎÒ¶ÔSESSIONµÄdz¼û°É¡£
ͨ¹ýini_set('session.use_trans_sid', 0);ÉèÖÃÔËÐл·¾³ÖйØÓÚSESS ......
Óà PHP ¶ÁÈ¡ºÍ±àд XML DOM
ʹÓà DOM ¿â¡¢SAX ½âÎöÆ÷ºÍÕýÔò±í´ïʽ
ÓÐÐí¶à¼¼Êõ¿ÉÓÃÓÚÓà PHP ¶ÁÈ¡ºÍ±àд XML¡£±¾ÎÄÌṩÁËÈýÖÖ·½·¨¶ÁÈ¡ XML£ºÊ¹Óà DOM ¿â¡¢Ê¹Óà SAX ½âÎöÆ÷ºÍʹÓÃÕýÔò±í´ïʽ¡£»¹½éÉÜÁËʹÓà DOM ºÍ PHP Îı¾Ä£°å±àд XML¡£
Óà PHP ¶ÁÈ¡ºÍ±àд¿ÉÀ©Õ¹±ê¼ÇÓïÑÔ£¨XML£©¿´ÆðÀ´¿ÉÄÜÓеã¿Ö²À¡£Êµ¼ÊÉÏ£¬XML ºÍËüµÄË ......
Èí¼þ°æ±¾:
php-5.2.13-Win32
apache_2.2.9-win32-x86-no_ssl-r2.msi(×¢Ò⣺APACHE 2.2.X°æ±¾ÒÔÉÏÒªÔö¼Ó²å¼þ²ÅÖ§³ÖPHP 5µÄ)
mysql-5.1.44-win32.msi
ÏÈ×°µÄphp5,Ö±½Ó½âѹÎļþµ½C:\php(°²×°µ½ÄÄÀï²¢²»»áÓÐÓ°Ï죬ƾ¸öÈËϲºÅ£¬±¾ÎÄÖеÄËùÓз¾¶¶¼ÒÔÎҵݲװ·¾¶£¬Çë´ó¼ÒÔÚ×Ô¼ºµÄ»úÆ÷ÉÏ°²×°µÄʱºò×¢ÒâÐÞ¸ÄΪ×Ô¼ºµÄ·¾¶)
½Ó× ......
ÅäÖÃLinux wget,yum ʹÓôúÀí·ÃÎÊÍøÂç¡£
Èç¹ûÄãµÄlinuxÖ÷»úÐèҪͨ¹ý´úÀí·þÎñÆ÷²ÅÄÜ·ÃÎÊÍⲿÍøÂç¡£¿ÉÒÔͨ¹ýÈçÏ·½Ê½ÊµÏÖ¡£
1.wget
ÐèÒªÔÚµ±Ç°Óû§µÄĿ¼Ï´´½¨Ò»¸ö".wgetrc"Îļþ
[root@linux ~]#vi .wgetrc
http-proxy = 10.1.18.34:3128
ftp-proxy = 10.1.18.34:3128
·Ö±ð±íʾhttpµÄ´úÀí·þÎñÆ÷ºÍftpµÄ´úÀí·þÎñÆ÷¡£Èç ......
¿âÓж¯Ì¬Ó뾲̬Á½ÖÖ£¬¶¯Ì¬Í¨³£ÓÃ.soΪºó׺£¬¾²Ì¬ÓÃ.aΪºó׺¡£ÀýÈ磺libhello.so libhello.a
ΪÁËÔÚͬһϵͳÖÐʹÓò»Í¬°æ±¾µÄ¿â£¬¿ÉÒÔÔÚ¿âÎļþÃûºó¼ÓÉÏ°æ±¾ºÅΪºó׺,ÀýÈ磺 libhello.so.1.0,ÓÉÓÚ³ÌÐòÁ¬½ÓĬÈÏÒÔ.soΪÎļþºó׺Ãû¡£ËùÒÔΪÁËʹÓÃÕâЩ¿â£¬Í¨³£Ê¹Óý¨Á¢·ûºÅÁ¬½ÓµÄ·½Ê½¡£
ln -s libhello.so.1.0 libhello.so.1 ......