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

ÔÚCENT OSÉϱàÒë°²×°APACHE+PHP+MYSQL

 Ô´ÂëĿ¼£º/usr/local/src/
 Ó¦ÓÃĿ¼£º/usr/local/app/
Ò»¡¢MYSQL°²×°¡£
 1.ÏÂÔØMSYQLÔ´Â룺
http://www.mysql.com/downloads/mysql/
×î½ü°æ±¾ÊÇ mysql-5.1.47.tar.gz
2.ÉÏ´«µ½·þÎñÆ÷Ŀ¼/usr/local/src/
cd /usr/local/src/
tar zxvf mysql-5.1.47.tar.gz
cd mysql-5.1.47
./configure --prefix=/usr/local/app/mysql --with-extra-charsets=all --with-unix-socket-path=/tmp/mysql.sock
make
make install
°²×°Íê±Ï¡£
3. ³õʼ»¯MYSQL
cp /usr/local/app/mysql/share/mysql/my-medium.cnf /etc/my.cnf
/usr/local/app/mysql/bin/mysql_install_db
cp /usr/local/app/mysql/share/mysql/mysql.server /etc/init.d/mysqld
4.´´½¨MYSQLÓû§
groupadd mysql
useradd mysql -d /usr/local/app/mysql/var -g mysql
5.Æô¶¯mysql
/etc/init.d/mysqld start
¶þ.°²×°APACHE
1.ÏÂÔØHTTPD
http://labs.renren.com/apache-mirror/httpd/
ÏÂÔØ×îÐ嵀 httpd-2.2.15.tar.gz 
2.ÉÏ´«µ½·þÎñÆ÷ /usr/lcoal/src/
cd /usr/lcoal/src/
tar zxvf httpd-2.2.15.tar.gz
cd /usr/lcoal/src/httpd-2.2.15
 ./configure --prefix=/usr/local/apache --enable-so --enable-mods-shared=most
make
make install
Èý¡¢°²×°PHP
1.ÏÂÔØPHP
http://www.php.net/downloads.php
ÏÂÔØ×îа汾 php-5.3.2.tar.gz
2.ÉÏ´«µ½·þÎñÆ÷ /usr/lcoal/src/
tar zvfx php-5.3.2.tar.gz
cd php-5.3.2
./configure --with-apxs2=/usr/local/app/apache/bin/apxs --with-zlib-dir --with-libxml-dir --with-jpeg-dir --with-png-dir --with-gd --with-mysql=/usr/local/app/mysql --with-pdo-mysql=/usr/local/app/mysql --with-mysqli=/usr/local/app/mysql/bin/mysql_config
make
make install
3.ÅäÖÃAPACHEÖ§³ÖPHP5
ÐÞ¸Ähttpd.conf
vi /usr/lcoal/app/apache/conf/httpd.conf
httpd.conf ÖÐÌí¼Ó
LoadModule php5_module modules/libphp5.so
httpd.conf ÖÐÌí¼Ó
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps
ÖØÆôapache
/usr/local/app/apache/bin/apachectrl start


Ïà¹ØÎĵµ£º

PHPÖеij£ÓõÄ25¸öMYSQLº¯Êý


1¡¢mysql_connect()-½¨Á¢Êý¾Ý¿âÁ¬½Ó
¸ñʽ£º
resource mysql_connect([string hostname [:port] [:/path/to/socket] [, string username] [, string password]])
Àý£º
$conn = @mysql_connect(”localhost”, “username”, “password”) or dir(”²»ÄÜÁ¬½Óµ½Mysql Server” ......

̽ÌÖPHP SQL×¢ÈëµÄ½â¾ö˼·

˼·:SQLÀᄀ¿ÉÄܵIJÉÓÃÁ½¸öÒýºÅ±ÕºÏ±äÁ¿;¶Ô±äÁ¿ÖеÄÒýºÅתÒå;¶Ô²»ÄܲÉÓÃ2¸öÒýºÅ±ÕºÏµÄ±äÁ¿,ÏÈÔ¤ÏÈÅжϱäÁ¿ÀàÐÍ;  
   
  ·½°¸:  
  1   ËùÓзÇÊýÖµÔËËã(Èç×Ö·û,¼òµ¥ÊýÖµÐ͵ȵÈ)µÄSQL±äÁ¿¶¼¼ÓÒýºÅ;  
  2   ËùÓзÇÊýÖµÔËËãµÄSQL±äÁ¿µÄÖµ¶¼²ÉÓÃmagic_quotes_gpc» ......

PHP µÄ×Ö·û´®±í´ïÈýÖÖ·½Ê½


µ¥ÒýºÅ
      $str = 'ÎÒÊÇһͷ´ó»ÒÀÇ';
Ë«ÒýºÅ
      $str2 = "ÄãÒ²ÊÇһͷ´ó»ÒÀÇ";
¶¨½ç·û
      $str3 = <<< DDD
          ¶¼ÊÇ´ó»ÒÀÇ£¬
   &nb ......

PHPÓÃÓʼþÈ¡»ØÍü¼ÇÃÜÂ빦ÄÜ£¿

wangjimima.php
<form id="form1" name="form1" method="post" action="mailto.php" onSubmit="return CheckForm()">
<input name="username" type="text" class="in" id="username" size="30" onmouseover="fEvent('mouseover',this)" onfocus="fEvent('focus',this)" onblur="fEvent('blur',this)" onmouseout ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ