- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的目标是将Laravel的git repo与php-fpm的xdebug一起使用:
https://github.com/aschmelyun/docker-compose-laravel
在使用此仓库时,我运行:
FROM php:7.4-fpm-alpine
ADD ./php/www.conf /usr/local/etc/php-fpm.d/www.conf
RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel
RUN mkdir -p /var/www/html
RUN chown laravel:laravel /var/www/html
WORKDIR /var/www/html
RUN docker-php-ext-install pdo pdo_mysql
我还在这里添加了端口(compose.dockerfile):
php:
build:
context: .
dockerfile: php.dockerfile
container_name: php
volumes:
- ./src:/var/www/html:delegated
ports:
- "9000:9000"
# Added next line:
- "9001:9001"
networks:
- laravel
我尝试将其添加到php.dockerfile的末尾:
# Install essential build tools
RUN apk add --no-cache \
git \
yarn \
autoconf \
g++ \
make \
openssl-dev
# Install xdebug
RUN docker-php-source extract \
&& pecl install xdebug \
&& echo "xdebug.remote_enable=on\n" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_autostart=on\n" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_port=9001\n" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_handler=dbgp\n" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.remote_connect_back=1\n" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& docker-php-ext-enable xdebug \
&& docker-php-source delete \
&& rm -rf /tmp/*
这是我在添加上述行时遇到的错误(似乎无关,但我猜想它打破了某些依赖性):
mysql | Version: '5.7.29' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
composer | list [--xml] [--raw] [--format FORMAT] [--] [<namespace>]
composer |
npm exited with code 1
composer exited with code
我尝试了其他在Google上找到的东西。但是无法使其正常工作(因为我真的不明白自己的工作)。我认为以上感觉就像是我关闭了,但也许我完全错了。
最佳答案
我找到了有关如何设置的说明here。将其添加到php.dockerfile的末尾:
# Install base packages
RUN apk update
RUN apk upgrade
# xdebug with VSCODE
ENV XDEBUG_VERSION=2.9.2
RUN apk --no-cache add --virtual .build-deps \
g++ \
autoconf \
make && \
pecl install xdebug-${XDEBUG_VERSION} && \
docker-php-ext-enable xdebug && \
apk del .build-deps && \
rm -r /tmp/pear/* && \
echo -e "xdebug.remote_enable=1\n\
xdebug.remote_autostart=1\n\
xdebug.remote_connect_back=0\n\
xdebug.remote_port=9001\n\
xdebug.idekey=\"VSCODE\"\n\
xdebug.remote_log=/var/www/html/xdebug.log\n\
xdebug.remote_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# Change TimeZone
RUN apk add --update tzdata
ENV TZ=Europe/Bucharest
编辑:
For **Visual Studio Code** Here is the kaunch.json I used:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9001,
"pathMappings": {
"/var/www/html/public": "${workspaceFolder}/src/public"
},
}
]
}
关于php - 如何在php:7.4-fpm-alpine docker容器中启用xdebug?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63982010/
我正在尝试使用 FPM 模块安装 PHP,但我根本做不到。我在 Mac OS Big Sur 上 brew install php74 --with-fpm --with-debug --with-c
我在使用 traefik 设置 mailcow 时遇到问题,遇到网关超时。我对 nextcloud 也有这个问题,所以我真的很感兴趣,是什么导致了这些网关超时问题。 我猜这与端口 9000 和上游 p
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我在 Red Hat Linux 服务器上安装了 PHP 7,但显然由于在服务器上运行一些命令来配置 PHP,我丢失了 php-fpm.sock文件。 任何人都可以帮助我了解文件的内容吗? 最佳答案
我的情况是这样的,我有两个 Docker 容器: 在端口 9000 上运行 PHP-FPM 运行 nginx 并拥有 PHP 文件(PHP-FPM 容器应该可以访问这些文件吗?) 我不断收到以下错误:
项目的 Git 存储库:https://github.com/tombusby/docker-laravel-experiments (撰写本文时 HEAD 为 823fd22)。 这是我的 dock
我正在尝试获取在 Windows 上运行的 Homestead Improved Vagrant VM 实例。请参阅Homestead Improved on Github 。我正在遵循这个简单的介绍
我知道我真的很接近这个,但我无法得到最后一部分 在职的。我几乎可以肯定它与 WordPress 有关 容器和 PHP 容器需要在同一个目录下吗?所以 PHP可以处理那个目录下的文件吗?我一直在努力 一
501 25131 1 0 9:31下午 ?? 0:00.37 /usr/local/opt/php/sbin/php-fpm --nodaemonize 501 2
我正在尝试在 Docker 镜像上设置 php-fpm。 这是我的 docker-compose.yml 中的服务: wordpress-service: build: context:
我在使用PHP-FPM遇到这个奇怪的问题。首先,我不是PHP方面的专家。我正在构建一个应用程序,PHP将仅与MySQL通信以推送和提取数据。 问题: 我有一个Dockerfile,在其中我对PHP-F
这是我的 docker-compose.yml version: '2' services: web: image: nginx:latest ports:
我一直在尝试让 php-fpm (w nginx) 与默认端口 (9000) 一起工作,但它不起作用。我正在尝试使用 php 7.1(也尝试过 7.0 和 5.6)。服务启动正常,我还可以在 ss/n
我正在努力寻找适用于 php-fpm 的监视器配置。 这是我试过的: ### Monitoring php-fpm: the parent process. check process php-fpm
在 fastcgi_finish_request(); 语句后在我的 php 脚本中实现了一些后处理后,我担心会出现一些差异。 看起来 PHP 没有在 fastcgi_finish_request
当一个特别长的字符串被打印到 php5-fpm.log 时,该字符串在末尾被截断并显示“...”(不带引号)以表明它已被截断。我怎样才能让它显示整个字符串而不考虑长度? 如果需要的话,我将 Nginx
php fpm 网站上的文档说 php fpm 从 5.3.3 开始是 coe php 的一部分 我正在运行 5.3.10,如何检查它是否正常工作?我以为这是在端口上运行的服务? 最佳答案 假设你在
我有一个运行 Apache/2.2.22 (Debian)、PHP 5.6.17 作为 FPM 和 MySQL 5.6.25 的服务器。 该项目使用名为 Redaxo 的 CMS 运行(我认为这并不重
我刚刚安装了一个 nginx+php-fpm 服务器。一切似乎都很好,只是 PHP-FPM 从不将错误写入其日志。 fpm.conf [default] listen = /var/run/php-f
本文实例讲述了PHP-FPM 设置多pool及配置文件重写操作。分享给大家供大家参考,具体如下: 重写配置文件 1、清空php配置文件 命令:> /usr/local/php/etc/p
我是一名优秀的程序员,十分优秀!