Coder Social home page Coder Social logo

valet's Introduction

PHP 开发环境工具
---------------



业务场景:

 很多时候,我们在做PHP开发,需要配置虚拟主机来运行一个PHP项目。这时候我们需要先更改/etc/hosts去配置开发域名,然后去配置nginx 添加虚拟主机,并且不同的项目有自己的特点,如laravel 的index.php入口文件在public下。

为了省去以上繁琐步骤,我们只需要配置一个config文件,就可以省去以上所有步骤;

如,我们开发一个laravel 项目,使用此工具,只需要配置一下json

json:

{
  "domain":"dev",
  "paths":[
    "/home/app"
  ]
}

这个时候,只要是在/home/app下的项目,都可以在浏览器以http://defaut.dev域名去访问。省去了配置Nginx,配置hosts配置laralve Nginx rewire.



安装方法:

     1. 正常安装Nginx,php  
     2. 安装dnsmasql 实现泛域名解析 修改dnsmasql增加泛解析  address=/dev/127.0.0.1
     3. 现在本项目到任意目录
     4. 配置虚拟主机,vhost文件参考nginx-vhost.conf   换/Users/dolia/Code/nginx/index.php为实际安装脚本的index.php


使用方法

   修改valet/config.json 把自己的项目开发目录添加到config.json.paths中即可













valet's People

Contributors

dolia avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.