{"id":19696263,"url":"https://github.com/axiosleo/vagrant-php-devenv","last_synced_at":"2025-07-01T01:38:16.077Z","repository":{"id":102504764,"uuid":"159436578","full_name":"AxiosLeo/vagrant-php-devenv","owner":"AxiosLeo","description":"基于vagrant搭建php开发环境","archived":false,"fork":false,"pushed_at":"2018-12-05T12:35:36.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T01:03:08.843Z","etag":null,"topics":["centos7","nginx","php","vagrant","virtualbox"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AxiosLeo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-28T03:14:17.000Z","updated_at":"2018-12-29T02:22:32.000Z","dependencies_parsed_at":"2023-03-13T15:19:06.081Z","dependency_job_id":null,"html_url":"https://github.com/AxiosLeo/vagrant-php-devenv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AxiosLeo/vagrant-php-devenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxiosLeo%2Fvagrant-php-devenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxiosLeo%2Fvagrant-php-devenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxiosLeo%2Fvagrant-php-devenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxiosLeo%2Fvagrant-php-devenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AxiosLeo","download_url":"https://codeload.github.com/AxiosLeo/vagrant-php-devenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxiosLeo%2Fvagrant-php-devenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260857363,"owners_count":23073435,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["centos7","nginx","php","vagrant","virtualbox"],"created_at":"2024-11-11T19:34:26.640Z","updated_at":"2025-06-20T01:04:31.688Z","avatar_url":"https://github.com/AxiosLeo.png","language":null,"readme":"# vagrant-php-devenv\n基于vagrant搭建php开发环境\n\n## 使用vagrant+virtualBox搭建开发环境的优点\n1. 更灵活的扩展安装。\n2. 更方便的软件安装与环境搭建。毕竟是系统级的，有更高的权限。\n3. 与宿主机环境隔离，即便环境折腾废了，destroy后，重新init就可以\n4. 共享项目目录，在宿主机开发的代码，会直接同步在虚拟机中，无需部署代码\n5. 更灵活的网络配置，可配置使用宿主机的代理，轻松实现外网资源的下载，比如加速github项目下载速度或composer国外镜像站下载速度。\n\n## package下载\n\u003e [百度网盘](https://pan.baidu.com/s/1KX3Ho5PwCbxlBCRwIa0Xig)\n\u003e 密码：jmiu\n\n## 安装vagrant和virtualBox\n\u003e [vagrant下载地址](https://www.vagrantup.com/downloads.html)\n\n\u003e [VirtualBox下载地址](https://www.virtualbox.org/wiki/Downloads)\n\n## 使用方式\n1. 进入本地工作目录(需要共享进虚拟机的目录)\n2. 执行以下命令\n```shell\n#安装vagrant插件\nvagrant plugin install vagrant-vbguest\n# 导入package.box镜像文件\nvagrant box add php-dev-env centos7.3-php7.2.12-nginx1.12.2.box\n# 初始化，生成Vagrantfile配置文件\nvagrant init php-dev-env\n```\n\n3. 编辑目录内的Vagrantfile文件\n```shell\n# -*- mode: ruby -*-\n# vi: set ft=ruby :\n\n# All Vagrant configuration is done below. The \"2\" in Vagrant.configure\n# configures the configuration version (we support older styles for\n# backwards compatibility). Please don't change it unless you know what\n# you're doing.\nVagrant.configure(\"2\") do |config|\n  config.vm.box = \"php-dev-env\"\n  config.vm.network \"private_network\", type: \"dhcp\"\n  config.vbguest.auto_update = false\n  config.vbguest.no_remote = true\n  config.vm.synced_folder \".\", \"/www\",owner: \"vagrant\",group: \"vagrant\",mount_options:[\"dmode=777\",\"fmode=777\"]\nend\n```\n\n4. 启动虚拟机\n```shell\nvagrant up\n#自动挂载插件\nvagrant vbguest --auto-reboot\n```\n\n5. 进入虚拟机\n``` shell\nvagrant ssh\n```\n\n## 系统环境\n用户名密码\n```shell\nusername  password\nvagrant   vagrant\nroot      vagrant\n```\n\n## 项目挂载路径\n项目目录 `/www/`\nnginx虚拟机配置目录 `/www/nginx.conf.d/`\n\n## PHP环境\n版本\n```shell\n$ php -v\nPHP 7.2.12 (cli) (built: Nov 28 2018 02:21:36) ( NTS )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\n```\n\n常用路径\n```shell\nphp路径： /usr/local/php7/\nphpize路径： /usr/local/php7/bin/phpize\nphp-config路径： /usr/local/php7/bin/php-config\nphp.ini路径： /usr/local/php7/lib/php.ini\n\n/usr/local/php7/etc/php-fpm.conf\n/usr/local/php7/etc/php-fpm.d/www.conf\n/etc/init.d/php-fpm\n```\n\nphp服务管理\n```shell\nservice php-fpm restart\nservice php-fpm start\nservice php-fpm stop\nservice php-fpm status\n```\n\n扩展安装\n\u003e [CenOS7环境安装PHP7扩展](https://hanxv.cn/archives/25.html)\n\n## nginx版本\n```shell\n$ nginx -v\nnginx version: nginx/1.12.2\n```\n\nnginx服务管理\n```shell\nservice nginx restart\nservice nginx start\nservice nginx stop\nservice nginx status\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxiosleo%2Fvagrant-php-devenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxiosleo%2Fvagrant-php-devenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxiosleo%2Fvagrant-php-devenv/lists"}