ÊÖ¶¯ÅäÖÃnginx+php cgi+zend+mysql
±¾ÎÄÊʺÏCentOS¡£Ò»²½Ò»²½À´£¬²»Òª´í¡£
ÏÈÏÂÔع¤¾ßssh shell£¬¸öÈ˸оõÕâ¸ö±È½ÏºÃÓã¬ÍƼö¸ø´ó¼Ò
http://docs.isvps.net/soft/SSHSecureShellClient-3.2.9.zip
È»ºóÊÇһЩ±ØÒªµÄÈí¼þ°ü
nginxÔ´Âë°ü: http://www.nginx.org/download/nginx-0.7.65.tar.gz
phpÔ´Âë°ü: http://cn.php.net/distributions/php-5.2.11.tar.gz
php-fpm²¹¶¡: http://php-fpm.org/downloads/php-5.2.11-fpm-0.5.13.diff.gz
Ò».×¼±¸¹¤×÷
1.ssh µÇ¼µ½VPS,µ±Ç°Ä¿Â¼ÊÇ /root, ²»Òª¶¯¡£
2.ÓÃwgetÃüÁîÏÂÔØÉÏÊöÈí¼þ°ü
wget http://www.nginx.org/download/nginx-0.7.65.tar.gz
wget http://cn.php.net/distributions/php-5.2.11.tar.gz
wget http://php-fpm.org/downloads/php-5.2.11-fpm-0.5.13.diff.gz
3.°²×°Ò»Ð©±ØÒªµÄϵͳÈí¼þ°ü£¬ÕâЩ¶¼ÊDZØÐëµÄ°ü£¬ËûÃǵŦÄÜÇë´ó¼Ò×Ô¼º°Ù¶È£¬°Ù¶È²»µ½¾Í¹È¸è£¬¹È¸è²»µ½ÔÙÌáÎÊ
yum install gcc
yum install patch
yum install pcre-devel.i386
yum install openssl-devel.i386
yum install libxml2-devel.i386
yum install libjpeg-devel.i386
yum install libpng-devel.i386
yum install mysql-devel.i386
¶þ.°²×°nginx
1.ÏÈ¿´¿´×Ô¼ºÔÚÄĸöĿ¼ÀïÃæ
pwd
È·¶¨µ±Ç°Ä¿Â¼ÊÇ:
/root
²»ÊǵĻ°
cd /root
2.½âѹnginx
tar zxvf nginx-0.7.65.tar.gz
3.½øÈënginxÔ´ÂëĿ¼
cd nginx-0.7.65
4.ÅäÖÃnginx±àÒëÎļþ
./configure --prefix=/usr/local/nginx
5.±àÒë²¢°²×°nginx
make && make install
nginxµÄ°²×°Ä¿Â¼±»ÉèÖÃÔÚ =/usr/local/nginx
6.ÔËÐÐnginx
/usr/local/nginx/sbin/nginx
nginx °²×°³õ²½Íê³É£¬´Ëʱ¿ÉÒÔÓà ip ·ÃÎʵ½»¶Ó½çÃæ¡£
Èý. ¸øphp´òÉÏphp-fmp²¹¶¡£¬²¢°²×°php
1.·µ»Ø /root
cd /root
2.½âѹphp-fpm ºÍ php Ô´Âë°ü
gunzip php-5.2.11-fpm-0.5.13.diff.gz
tar zxvf php-5.2.11.tar.gz
3.´ò²¹¶¡
patch -d php-5.2.11 -p1 < php-5.2.11-fpm-0.5.13.diff
4.½øÈë php Ô´ÎļþĿ¼
cd php-5.2.11
5.ÅäÖà php ±àÒëÎļþ
./configure --prefix=/usr/local/php --enable-fastcgi --enable-fpm --enable-magic-quotes --enable-libxml --enable-ftp --with-gd --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib --with-mysql --enable-zip --enable-zend-multibyte
6.±àÒë php
make && make install
phpµÄ±»°²×°ÔÚ /usr/local/php
7.ÐÞ¸Ä /us
Ïà¹ØÎĵµ£º
ÔÚÏßʵʱÁÄÌìϵͳ£¬Ò»Ö±ÊÇÒ»¸ö±È½ÏÂé·³µÄ¶«Î÷¡£
Ò»°ãʵÏÖÔÚÏßʵʱÁÄÌ죬ÊÇÀûÓÃJSÔÚ¿Í»§¶ËʹÓÃajaxÿ¸ôÒ»¶¨µÄʱ¼ä¾Í·µ»Ø·þÎñÆ÷ÇëÇóÊý¾Ý£¬Èç¹ûÓÐеÄÁÄÌìÐÅÏ¢ÔòÓÃJS³ÊÏÖ¸øÓû§
ÎÒÃDz»ËµÕâÑù×öµÄÀû±×£¬Ö±½ÓÇÐÈëÕýÌ⣬ÈçºÎÀ´ÊµÏÖ·þÎñÆ÷ÍƵÄÔÚÏßÁÄÌìϵͳ
Ê×ÏÈ£¬ÎÒÏÈÇë´ó¼Ò¿´Ò»¸öÀý×Ó
¸´ÖÆ´úÂë
<?php
while(true){
&n ......
±¾ÎļǼһϱ¾ÈË°²×°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-commu ......
<?
@session_start();
$counter = intval(file_get_contents("counter.dat"));
if(!$_SESSION['jingyun'])
{
$_SESSION['jingyun'] = true;
$counter++;
$fp = fopen("counter.dat","w");
fwrite($fp, $counter);
fclose($fp);
}
?>
×Ü·ÃÎÊ <span style="font-size:14px; color:#FF6600" mce_sty ......
ÔÚhead.htmÖмÓÈ룬Ҳ¾ÍÊÇÔÚĬÈÏÄ£°æÖÐÌí¼Ó“$stime=microtime(true); //»ñÈ¡³ÌÐò¿ªÊ¼Ö´ÐеÄʱ¼ä”
¾ä
<!--<?php
$stime=microtime(true); //»ñÈ¡³ÌÐò¿ªÊ¼Ö´ÐеÄʱ¼ä
$GuideFid[$fid]=str_replace("<a href='$webdb[www_url]' class='guide_menu'>>Ê×Ò³</a>","",$GuideFid[$fid]);
$f ......
ÎÄ/Fenying
¡¡¡¡ÀýÈçÓг£ÓÃʱ¼ä¸ñʽ yyyy-mm-dd HH:ii:ss£¬ÈçºÎת»»³ÉPHPÖÐdateº¯Êý¿ÉʹÓõÄʱ¼ä¸ñʽÄØ£¿
¡¡¡¡Ê¹Óà PHPTimeFormatfromCommon() ¿ÉÒÔ°ÑͨÓÃʱ¼ä¸ñʽת»»³ÉPHPʱ¼ä¸ñʽ
¡¡¡¡¡¡¡¡PHPTimeFormatfromCommon('yyyy-mm-dd HH:ii:ss') => 'Y-m-d H:i:s'
¡¡¡¡Ê¹Óà PHPTimeFormatToCommon() ¿ÉÒÔ° ......