配置php开发环境

  1. 在windows中下载安装Oracle VM VirtualBox虚拟机。各个版本的下载地址:https://www.virtualbox.org/wiki/Downloadsphp

  2. 固定Host-Only的ip
    mysql

  3. 在虚拟机中安装centos6.6,设置两张网卡,第一张为NAT,第二张为Host-Only。
    linux

  4. 配置linux网络, vi /etc/sysconfig/network-scripts/ifcfg-eth0,eth1只需修改成ONBOOT=yesnginx

  5. DEVICE=eth0
    HWADDR=08:00:27:BA:37:8C
    TYPE=Ethernet
    UUID=a80d14be-d246-4f01-8035-0a74ff51b3b4
    ONBOOT=yes
    NM_CONTROLLED=yes
    BOOTPROTO=dhcpgit

  6. 安装php环境 教程地址 : https://github.com/lj2007331/lnmpgithub

  7. 改php.ini,关闭zend opcachesql

  8. 改nginx.conf, sendfile off。windows

  9. 在本地window系统建www,conf,logs文件夹而且共享,本地window系统必须设置用户名跟密码。centos

  10. 在linux 系统中的 /srv目录创建上述对应的三个目录网络

  11. 查看www的gid,uid 。cat /etc/passwd

  12. 在/etc/fstab中写入

  13. //192.168.56.1/www    /srv/www    cifs,rw    username=用户名,password=密码,noperm,gid=505,uid=504,file_mode=0777,dirmode=0777,auto 0 0
    //192.168.56.1/conf   /srv/conf    cifs,rw    username=用户名,password=密码,noperm,gid=504,uid=504,file_mode=0777,dirmode=0777,auto 0 0
    //192.168.56.1/logs   /srv/logs    cifs,rw    username=用户名,password=密码,noperm,gid=504,uid=504,file_mode=0777,dirmode=0777,auto 0 0
  14.   在/etc/rc.local中写入

  15. mount -a
    service php-fpm restart
    service nginx restart
    service mysqld restart
  16. 最后修改nginx的配置。vi /usr/local/nginx/conf/nginx.conf