使用 Docker 开发 PHP 项目(一):安装

PHP即“超文本预处理器”,是一种通用开源 脚本语言。PHP是在服务器端执行的 脚本语言,与C语言类似,是常用的网站编程语言。PHP独特的语法混合了C、Java、Perl以及 PHP 自创的语法。

使用 Docker 开发 PHP 项目(一):安装使用 Docker 开发 PHP 项目(一):安装

安装Docker

《Ubuntu安装和配置Docker-CE镜像加速》

准备项目

使用本人的项目 khs1994-docker/lnmp 来作为 LNMP 环境。

安装
$ git clone --recursive https://github.com/khs1994-docker/lnmp.git
# $ git clone --recursive git@github.com:khs1994-docker/lnmp.git
中国镜像
$ git clone --recursive https://code.aliyun.com/khs1994-docker/lnmp.git
# $ git clone --recursive git@code.aliyun.com:khs1994-docker/lnmp.git
启动 Demo
$ cd lnmp
$ ./lnmp-docker up
Windows 10 打开 Power Shell 执行

Windows 10 PowerShell 默认禁止执行脚本,请以管理员打开 PowerShell 执行以下 命令解除限制

$ set-ExecutionPolicy RemoteSigned

输入 `Y` 确认

验证环境
$ curl 127.0.0.1
Welcome use khs1994-docker/lnmp v18.09 x86_64 With Pull Docker Image
development
Windows
$ wsl curl 127.0.0.1

原文地址: https://www.linuxprobe.com/php-docker-install.html

请使用浏览器的分享功能分享到微信等