系统环境搭建
基础:linux+php+mysql+redis
升级:CDN,只能DNS,分布式缓存,全国多节点,多线路接入(内容分发网络)
硬件升级:负载均衡LVS (高效稳定) 大型WEB集群
环境准备
软件:phpstorm/EditPlus/Eclipse PHP Deceloperss
环境:macos
mysql封装
<?php
$config['db']['master'] = array(
'host'=>'127.0.0.1:3306',
'user'=>'root',
'password'=>'root',
'dbname'=>'miaosha',
);
$config['db']['slave'] = array(
'host'=>'127.0.0.1:3306',
'user'=>'root',
'password'=>'root',
'dbname'=>'miaosha',
);
redis 封装
`
$config['redis']['instance1'] = array(
'default' => array(
'host' => '127.0.0.1',
'port' => '6379',
'timeout' => 5,
'pconnect' => 1,
'password' => '',
)
);
$config['redis']['instance2'] = array(