简体   繁体   English

在centos映像上使用php5.3的docker

[英]docker for php5.3 on centos image

I want to run legacy php 5.3 apps on centos 7. Since there is no php 5.3 build on centos 7, docker container looks like a preferred option. 我想在centos 7上运行旧版php 5.3应用程序。由于在centos 7上没有php 5.3构建,docker容器看起来像是一个首选选项。 I referred to this article to build a docker container but I am unable to access the php web pages from port 9003 in local host. 我参考了这篇文章来构建docker容器,但是我无法从本地主机的端口9003访问php网页。 The following are places where I may need help. 以下是我可能需要帮助的地方。

  1. There was an issue with using sockets in line 1 of the script, so I just deleted this line 在脚本的第1行中使用套接字存在问题,因此我刚刚删除了这一行
  2. The container runs fine but when I run localhost:9003 on the browser I am not able to serve php pages from /var/www/html 容器运行正常,但是当我在浏览器上运行localhost:9003时,我无法从/ var / www / html提供php页面

I want to have apache and php files on local and only want to run php on the container.. 我想在本地有apache和php文件,只想在容器上运行php。

help is greatly appreciated 非常感谢帮助

The container runs fine but when I run localhost:9003 on the browser I am not able to serve php pages from /var/www/html 容器运行正常,但是当我在浏览器上运行localhost:9003时,我无法从/ var / www / html提供php页面

You need to expose the ports by adding -p 9003:9003 to the run command. 您需要通过在运行命令中添加-p 9003:9003来公开端口。

Try run docker with network parameter like --network=<NETWORK> . 尝试使用--network=<NETWORK>类的网络参数运行--network=<NETWORK> looking for available network use command docker network ls . 寻找可用的网络使用命令docker network ls

i advise to use the bridge network mode: 我建议使用网桥网络模式:

docker --network=bridge

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM