(Rockylinux+ php+ apache)获得503服务不可用的错误
我希望每个人都过得很好。 我创建了一个岩石Linux容器,其中包括PHP和Apache。我使用:8080
端口打开。每当我尝试通过进入localhost:8080
获得503服务不可用时,每当我尝试从Web浏览器到达Web服务器 - 由于维护停机时间或容量问题,服务器无法暂时服务您的请求。请稍后再试。
错误。我不知道下一步该怎么做。我该如何解决这个问题?谢谢!
这是我的Dockerfile:
RUN dnf update -y
RUN dnf install httpd -y
RUN dnf install php -y
RUN dnf install procps -y
RUN dnf install net-tools -y
RUN dnf install findutils -y
RUN dnf install vim -y
RUN dnf install git -y
RUN mkdir /run/php-fpm
ADD index.php /var/www/html/
CMD apachectl -D FOREGROUND```
I hope everyone is doing well.
I have created a Rocky Linux container that includes PHP and Apache. I run the image with :8080
port open. Whenever I try to reach the web server from a web browser by going into localhost:8080
I get 503 Service Unavailable - The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
error. I couldn't figure what to do next. How can I solve this issue? Thanks!
This is my Dockerfile:
RUN dnf update -y
RUN dnf install httpd -y
RUN dnf install php -y
RUN dnf install procps -y
RUN dnf install net-tools -y
RUN dnf install findutils -y
RUN dnf install vim -y
RUN dnf install git -y
RUN mkdir /run/php-fpm
ADD index.php /var/www/html/
CMD apachectl -D FOREGROUND```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
“在RHEL 8/Rocky Linux 8上,[MOD_PHP]已被弃用,并且默认情况下对PHP-FPM(FPM:FASTCGI Process Manager)进行了配置。”
检查PHP-FPM服务是否正在运行。如果默认情况下它不是(很可能不是),则可以修改dockerfile,以便
在
dockerfile
中启动php-fpm 尝试以下操作:"On RHEL 8/Rocky Linux 8, [mod_php] has been Deprecated and PHP-FPM (FPM : FastCGI Process Manager) is configured by default."
Check to see if the php-fpm service is running. If its not by default (which it most likely is not) you can modify the Dockerfile to also start php-fpm
In your
Dockerfile
try something like: