配置php开发环境

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

  2. 固定Host-Only的ip

  3. 配置php开发环境_第1张图片

  4. 配置php开发环境_第2张图片

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

  6. 配置linux网络, vi /etc/sysconfig/network-scripts/ifcfg-eth0,eth1只需修改为ONBOOT=yes

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

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

  9. 改php.ini,关闭zend opcache

  10. 改nginx.conf, sendfile off。

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

  12. 在linux 系统中的 /srv目录建立上述对应的三个目录

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

  14. 在/etc/fstab中写入

  15. //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
  16.   在/etc/rc.local中写入

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

你可能感兴趣的:(linux,PHP,开发,挂载)