LAMP(Linux+Apache+Mysql+PHP)²¿ÊðÈÕÖ¾
±¾ÎļǼһϱ¾ÈË°²×°LAMPµÄÈ«¹ý³Ì
±¾ÈËʹÓõÄLinuxΪRedHat Enterprise 5 X64
µÚÒ»²½:°²×°Mysql
MysqlµÄ°²×°±È½Ï¼òµ¥£¬ÎªÁ˱ÜÃâ³öÏÖÎļþÕÒ²»µ½µÄÇé¿ö£¬ÎÒÒÀ´ÎÏÂÔØ°²×°ÁËÒÔÏÂ4¸öRPM°ü
MySQL-server-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-client-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-devel-community-5.1.46-1.rhel5.x86_64.rpm
MySQL-shared-community-5.1.46-1.rhel5.x86_64.rpm
µÚ¶þ²½£º°²×°Apache
ÆäʵÊÇ°²×°ApacheÏîĿϵÄhttpd
1¡¢´Ó http://httpd.apache.orgÏÂÔØÎļþhttpd-2.2.14.tar.bz2 2.
2¡¢½âѹËõ
$ bzip2 –d httpd-2.2.14.tar.bz2
$ tar –xvf httpd-2.2.14.tar
3¡¢ÅäÖÃ
$ cd httpd-2.2.14
$ ./configure --prefix=/usr/local/apache --enable-so
¼´½«°²×°ÔÚ·¾¶/usr/local/apache Ï¡£
4¡¢±àÒë²¢°²×°
$ make
$ make install
½«»á°²×°µ½--prefixÖ¸¶¨µÄ/usr/local/apacheÏÂÃæ
6¡¢¶¨ÖÆÅäÖÃÎļþ
$ vi /usr/local/apache/conf/httpd.conf
7¡¢²âÊÔ
Start Apache HTTP Server bu running:
$ /usr/local/apache/bin/apachectl -k start
It should be able to request your first document via http://localhost. The document is located in DocumentRoot, which is set in http.conf.
Stop the server
$ /usr/local/apache/bin/apachectl -k stop
µÚÈý²½£º°²×°PHP
´Óhttp://cn.php.netÏÂÔØphp-5.2.13.tar.bz2
½âѹËõ
$ bzip2 –d php-5.2.13.tar.bz2
$ tar –xvf php-5.2.13.tar
ÅäÖÃ
$ cd php-5.2.13
$ ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache/bin/apxs --with-mysql
Õâʱºò»á³öÏÖCannot find libmysqlclient under /usrµÄ´íÎó
Õâ¿ÉÄÜÒòΪÎÒµÄÊÇ64λµÄ£¬libmysqlclient.soÔÚ/usr/lib64ÏÂÃ棬ÓÚÊǽ«Æ俽±´µ½/usr/libÏÂÃæ
ÔÚÔËÐÐÕâʱºò£¬Í¨¹ýÁË¡£
ÆäÖÐ--with-apxs2=/usr/local/apache/bin/apxs Ó¦¸ÃÊÇÓëapache¹ØÁª£¬ÔÚÆä¶ÔÓ¦ÏÂÃæÉú³Élibphp5.so
±àÒë
$ make
²âÊÔ
$ make test
°²×°
$ make install
½«php.ini-dist ¿½±´µ½--with-config-file-pathËù±íʾµÄ/usr/local/php/etcĿ¼Ï¸ÄÃûΪphp.ini
ÐÞ¸ÄapacheµÄhttpd.confÎļþ ÔÚÆäÖмÓÉÏ AddType application/x-httpd-php .php
²¢×¢Òâ LoadModule php5_mod
Ïà¹ØÎĵµ£º
MySQL EVENT
À´Ô´£ºhttp://samyu.blog.51cto.com/344284/146011
event_scheduler:
The MySQL event scheduler is a thread that runs in the background looking for events to execute. It spends a lot of time sleeping -- and won't do anything unless the new global variable "event_scheduler" is set t ......
·þÎñÆ÷¶Ë´úÂë,amfphpµÄservicesĿ¼Ï½¨Á¢readData.phpÎļþ,´úÂëÈçÏÂ
<?php
class ReadDB
{
function getData()
&nb ......
<Ctrl><Alt><F1>
Çл»µ½µÚÒ»¸öÎı¾Öնˡ£ÔÚLinuxÏÂÄã¿ÉÒÔÓжà´ïÁù¸ö²»Í¬µÄÖնˡ£Õâ¸öÃüÁîµÄÒâ˼ÊÇ£º“ͬʱ°´×¡<Ctrl>¼üºÍ<Alt>¼ü£¬È»ºó°´<F1>¼ü£¬ÔÙÊÍ·ÅËùÓеļü”¡£
<Ctrl><Alt><Fn> (n=1..6)
Çл»µ½µÚn¸öÎı¾Öնˡ££¨ÄãÒ²¿ÉÒÔʹÓò»ÊǺܾ³£Óõ½µÄ ......
¹ÜµÀ¼°ÓÐÃû¹ÜµÀ
ÔÚ±¾ÏµÁÐÐòÖÐ×÷Õ߸ÅÊöÁË linux ½ø³Ì¼äͨÐŵļ¸ÖÖÖ÷ÒªÊֶΡ£ÆäÖйܵÀºÍÓÐÃû¹ÜµÀÊÇ×îÔçµÄ½ø³Ì¼äͨÐÅ»úÖÆÖ®Ò»£¬¹ÜµÀ¿ÉÓÃÓÚ¾ßÓÐÇ×Ôµ¹Øϵ½ø³Ì¼äµÄͨÐÅ£¬ÓÐÃû¹ÜµÀ¿Ë·þÁ˹ܵÀûÓÐÃû×ÖµÄÏÞÖÆ£¬Òò´Ë£¬³ý¾ßÓйܵÀËù¾ßÓеŦÄÜÍ⣬Ëü»¹ÔÊÐíÎÞÇ×Ôµ¹Øϵ½ø³Ì¼äµÄͨÐÅ¡£ ÈÏÇå¹ÜµÀºÍÓÐÃû¹ÜµÀµÄ¶Áд¹æÔòÊÇÔÚ³ÌÐòÖÐÓ¦Ó ......
Ò». ʲôÊÇÐźÅÁ¿
ÐźÅÁ¿(Semaphore)-- Ï൱һ¸öÐźŵƣ¬³ÌÐòÀïÊÇÒ»¸ö·Ç¸ºÕûÊý£¬±íʾ״̬.
¿ÉÒÔÓÃÀ´±£»¤Á½¸ö»ò¶à¸ö¹Ø¼ü´úÂë¶Î£¬ÕâЩ¹Ø¼ü´úÂë¶Î²»Äܲ¢·¢µ÷Óá£ÔÚ½øÈëÒ»¸ö¹Ø¼ü´úÂë¶Î֮ǰ£¬Ï̱߳ØÐë»ñÈ¡Ò»¸öÐźÅÁ¿¡£
Èç¹û¹Ø¼ü´úÂë¶ÎÖÐûÓÐÈκÎỊ̈߳¬ÄÇôÏ̻߳áÁ¢¼´½øÈë¸Ã¿òͼÖеÄÄǸö²¿·Ö¡£Ò»µ©¸Ã¹Ø¼ü´úÂë¶ÎÍê³ÉÁË£¬ÄÇô¸Ã ......