1. 建session目录
# mkdir -p /var/lib/php/session
# chown -R nginx:nginx /var/lib/php/session
2. 安装gd库和soap库
# yum --enablerepo=remi install -y php-gd
# yum --enablerepo=remi install -y php-soap
3. 把vividcase程序放到 nginx目录下
# cd /usr/share/nginx/html
# ln -s /root/vividphp/php_vividcase/Medicool
# chown -R nginx:nginx Medicool/public/images/captcha
4. 倒入数据库,先创建数据库 vividcase, 然后:
# mysql -u 用户名-密码 -D 数据库名< docs/medicool.sql
5. 修改 nginx 虚拟主机配置文件,添加以下内容:server
{
listen 80;
server_name IP地址;
location ~ \.php$ {
root /usr/share/nginx/html/Medicool/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/Medicool/public$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*\.(xml|mp4|ico|3gp|gz|MOV|PNG|JPG|gif|jpg|jpeg|png|bmp|swf|js|css|html|htm|exe|zip|caf|mov|ipa|plist|wav|pdf|amr)$ {
root /usr/share/nginx/html/Medicool/public;
}
location / {
root /usr/share/nginx/html/Medicool/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html/Medicool/public/index.php;
include fastcgi_params;
}
}
6. 重启 nginx
# service php-fpm restart
# service nginx restart