概要:
1.php 连接 oracle 需要拓展pdo_oci 和 oci8
2.安装pdo_oci 和 oci8 前必须把instantclient-basic 和 instantclient-sdk,不然无法完成安装。
废话不多说,直接上dockerfile
下载地址:https://nm.96laojie.com/Dockerfile
镜像启动命令:
docker run -d -p 9000:9000 -v 你的WWW地址:/var/www/html --name php 你镜像名
注意,启动的镜像只有php-fpm,并没有nginx,所以我们还得pull nginx 镜像下来。
命令:docker pull nginx
启动nginx ,需要Link 前面php-fpm,同时把本机www地址挂载到ginx镜像
参考命令:
docker run -d -p 80:80 --name nginx -v 你的WWW地址:/var/www/html --link php:php nginx
启动后,进入容器修改nginx连接php-fpm的配置(如何配置,网上教程很多,大家自行查找,修改好配置后,记得重启nginx):
参考命令:
docker exec -it nginx sh