CentOS 5.2 ÏÂÓÃYum°²×°Apache+PHP+MySQL»·¾³
1.
CentOS 5.2 ÏÂÓÃYum°²×°Apache+PHP+MySQL»·¾³
2009-04-03 23:47
Fedora 8ÏÂÓÃYum°²×°Apache+PHP+MySQL»·¾³
fedora8 ÓÃyumÀ´¹ÜÀí°²×°Apache+PHP+MysqlµÄ»ù±¾°²×°¡£
1. °²×°Apahce, PHP, Mysql, ÒÔ¼°phpÁ¬½Ómysql¿â×é¼þ¡£
yum -y install httpd php mysql mysql-server
php-mysql
centos°²×°php²å¼þ¾ÍÊÇyum install php-*
yum install php-gd °²×°Í¼ÐÎÖ§³Ö
Ò²¿ÉÒÔͨ¹ý¹âÇýiso°²×°
mount /dev/cdrom /mnt¹ÒÔعâÇýµ½mnt
rpm -ivh /mnt/centos/httpd ****.rpm
°²×°ISOÀïµÄ°ü
²âÊÔ»·¾³
rpm -qa |grep mysql
rpm -qa |grep httpd
rpm -qa |grep php
2. ÅäÖÿª»úÆô¶¯·þÎñ
/sbin/chkconfig httpd on
[ÉèÖÃapache·þÎñÆ÷httpd·þÎñ¿ª»úÆô¶¯]
/sbin/chkconfig --add mysqld
[ÔÚ·þÎñÇåµ¥ÖÐÌí¼Ómysql·þÎñ]
/sbin/chkconfig mysqld on
[ÉèÖÃmysql·þÎñ¿ª»úÆô¶¯]
/sbin/service httpd start
[Æô¶¯httpd·þÎñ,Ó뿪»úÆô¶¯ÎÞ¹Ø]
/sbin/service mysqld start
[Æô¶¯mysql·þÎñ,Ó뿪»úÎÞ¹Ø]
3.ÉèÖÃmysqlÊý¾Ý¿ârootÕʺÅÃÜÂë¡£
mysqladmin -u root password 'newpassword'
[ÒýºÅÄÚÌîÃÜÂë]
4. ÈÃmysqlÊý¾Ý¿â¸ü°²È«
mysql -u root -p
mysql> DROP DATABASE
test; [ɾ³ýtestÊý¾Ý¿â]
mysql> DELETE from mysql.user WHERE user =
''; [ɾ³ýÄäÃûÕÊ»§]
mysql> FLUSH
PRIVILEGES; [ÖØÔØȨÏÞ]
5. °´ÕÕÒÔÉϵݲװ·½Ê½, ÅäÖóöÀ´µÄĬÈÏÕ¾µãĿ¼Ϊ/var/www/html/
н¨Ò»
Ïà¹ØÎĵµ£º
¶ÔÓڽű¾°²È«Õâ¸ö»°ÌâºÃÏñÓÀԶûÍêûÁË£¬Èç¹ûÄã¾³£µ½¹úÍâµÄ¸÷ÖÖ¸÷ÑùµÄbugtraqÉÏ£¬Äã»á·¢ÏÖÓÐÒ»°ëÒÔÉ϶¼ºÍ½Å±¾Ïà¹Ø£¬ÖîÈçSQL
injection£¬XSS£¬Path Disclosure£¬Remote commands executionÕâÑùµÄ×ÖÑ۱ȱȽÔÊÇ£¬ÎÒÃÇ¿´ÁËÖ®ºóµÄÓÃ;ÄѵÀ½ö½öÊÇ×¥È⼦?¶ÔÓÚÎÒÃÇÏë×öweb°²È«µÄÈËÀ´Ëµ£¬×îºÃ¾ÍÊÇÄÃÀ´Ñ§Ï°
£¬¿ÉÊÇÍòÎï×¥¸ùÔ´£¬ÎÒà ......
PHP4:
<?
$sample1 = new StdClass();
$sample1->name = "Hasin";
$sample2 = $sample1;
$sample2->name = "Afif";
echo $sample1->name;
?>
In PHP4 it works differently; it will output Hasin, as both are different from
each other.
PHP5:
<?
$sample1 = new StdClass();
$ ......
ÓÉÓÚ ÔÚphp4µÄ»·¾³ÏÂ. ¶¼Ã»ÕÒµ½×Ô¶¯Éú³ÉµÄº¯Êý. ËùÒÔ×Ô¼º¸ÄдÁËÒ»¸ö±ðÈËЩµÄÀà. ÓÃÀ´×Ô¶¯Éú³Éxml Îļþ.
<?php
/*
*** ¹¦ÄÜ : php4×Ô動Éú³Éxml Îļþ類
*** @ edit: zxwo0o
*** @ time: 2009-9-22
*/
class php4xml{
var $version; //°æ±¾號
var $start; ......
memcache¸öÈËÀí½âÖ÷ÒªÊÇÓÃÀ´¹ÜÀíÄÚ´æµÄ,phpºÍmemcache½áºÏ¾Í¿ÉÒÔʹphp°ÉһЩÊý¾Ý±£´æÔÚmemcache¹ÜÀíµÄÄÚ´æÀï,·½±ã¹ÜÀí,Ò²¿ì,»¹Ö§³Ö¶ą̀·þÎñÆ÷¹²ÏíÊý¾Ý,·Ï»°²»¶à˵. ·ÖΪlinuxºÍwindows 1)linuxºÍÀàUnix¿ÉÒÔ´ÓÒÔϵØÖ·ÏÂÔØmemcachedºÍlibevent,ÓÉÓÚ°²×°memcacheÐèÒªlibeventÖ§³Ö,ËùÒÔÐèÒªÏÈ°²×°libevent memcached¹Ù·½ ......
ÔÚʵ¼ÊµÄ³ÌÐò¿ª·¢ÖУ¬Ö´ÐÐ×Ö·û´®Ìæ»»²Ù×÷ÊÇÒ»¼þ·Ç³£¾³£µÄÊ£¬¶Ôstr_replaceº¯ÊýµÄʵÓÃÒ²»á·Ç³£Æµ·±¡£
Õâ¶Îʱ¼äÔÚ¿´¡¶PHPºÍMySQL Web¿ª·¢¡·Ò»Êé¿´µ½str_replace½²½â£¬Ò»¶ÎСÌáʾдµ½£º¿ÉÒÔΪstr_replaceµÄÈý¸ö¶¼Ê¹ÓÃÊý×é´«È룬µ«½²½â±È½Ï¼òµ¥£¬ÓÚÊǾö¶¨×Ô¼º ......