Tag: FPM

与Apache不同的Php-Fpm容器

我的生产服务器正在运行一个经典的结构Db-Container,Server-Container和Php-Fpm容器的Docker。 我想要做的就是拆分源代码,以便为项目的三个主要部分分配不同的容器。 现在他们以mydomain.com/index为主要网站,mydomain.com/api和mydomain.com/adm作为其他服务。 我如何设置Apache虚拟主机以映射这样的请求? mydomain.com -> fcgi://siteFpm:9000 mydomain.com/api -> fcgi://apiFpm:9000 mydomain.com/cms -> fcgi://cmsFpm:9000 谢谢

在一个dockerfile中将PHP-fpm与nginx结合在一起

我需要在一个dockerfile中将php-fpm和nginx结合起来用于生产部署。 那么更好的是: (1)使用php:7.1.8-fpm启动dockerfile,然后在其上安装nginx图像层? (2)或者你推荐使用nginx图像,然后使用apt-get安装php-fpm? PS:我没有用于生产部署的docker-compose构build选项。 在我的开发环境中,我已经使用docker-compose并且从两个图像轻松地构build了多容器应用程序。 我们的组织devops不支持基于docker-compose的prod环境部署。

牧场主伙伴php-fpm端口映射

我正在使用这个docker工合成牧场主: version: '2' volumes: data: {} services: web: image: nginx:latest volumes: – /some_local_dir/services.conf:/etc/nginx/conf.d/site.conf volumes_from: – my-service ports: – 9082:80 labels: io.rancher.sidekicks: my-service my-service: image: my-service volumes: – my-service:/my-service ports: – 9001:9000 我的服务 – 是build立在alpine3.6上的图像,安装了php7-fpm 我的services.conf是: server { root /my-service/web; server_name my-service.local; location / { try_files $uri /app.php$is_args$args; } location ~ ^/app\.php(/|$) { fastcgi_pass my-service.web:9001; fastcgi_split_path_info […]

docker nginx连接拒绝连接到php fpm

我是新来的docker,我已经创build了一些容器的Web服务。所有的容器运行良好,但Nginx的容器无法访问的phpfpm容器。我检查了configuration文件,但什么也没有发现,这可能是networking问题,我有search了很多网站,似乎没有必要通过docker集装箱打开防火墙。所以,这是非常奇怪的,请帮助! nginx的error.log 2017/12/01 08:09:24 [error] 6#6:* 4连接()失败(111:连接被拒绝)连接上游时,客户端:172.18.0.1,服务器:localhost,请求:“GET / index .php HTTP / 1.1“,上行:”fastcgi://172.18.0.4:9000“,主机:”localhost:81“ 泊坞窗,compose.yml nginx vhost.conf location ~ \.php$ { fastcgi_pass phpfpm:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; }

与Docker的PHP7.0-FPM:无法加载dynamic库OCI8

我用PHP7.0-FPM和Apache 2.4创build了一个Docker Image。 我已经安装了InstantClient 12.2(基本+ sdk),我已经安装了oci8像这样: RUN echo "instantclient,/usr/lib/oracle/12.2/instantclient"| pecl install oci8 && \ echo "extension=oci8.so" > /etc/php/7.0/mods-available/oci8.ini && \ ln -s /etc/php/7.0/mods-available/oci8.ini /etc/php/7.0/fpm/conf.d/20-oci8.ini 我不知道为什么,但当我(重新)启动php7.0-fpm时,我得到这个警告: # service php7.0-fpm restart * Restarting PHP 7.0 FastCGI Process Manager php-fpm7.0 Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/oci8.so' – libmql1.so: cannot open shared object file: No such […]

在Docker容器中只logging来自PHP-FPM的真实致命错误

我在分离的Docker容器中使用PHP-FPM的NGINX。 我只想得到错误的stderr,以便我可以收集他们在一个集中的日志服务器上。 问题是:我使用WP,似乎有一些写得不好的插件。 他们的工作,但导致这样的警告: PHP错误:7#7:* 1 FastCGI在stderr中发送:“PHP消息:PHP警告:参数1到wp_default_scripts()有望成为引用,/ www / wp中给出的值 – 在601行包括/ plugin.php testing脚本示例,这应该会给stderr一个致命的错误: <?php not_existing_func(); PHP-FPM被configuration为将错误logging到stderr中,如下所示: [global] log_level = error error_log = /proc/self/fd/2 我想知道,这在上面的脚本没有给我什么。 就在我至lessnotice了log_level之后,我在docker容器的控制台上发现了exception: [17-Jun-2017 01:45:35]警告:[pool www] child 8对stderr说:“注意:PHP消息:PHP致命错误:未捕获错误:调用/ www / x中的未定义函数not_existing_func()。 PHP:2" 为什么这是地狱呢? 对我来说,我们在这里显然有一个致命的错误,就像这个消息指出的,导致脚本无法继续(当然,我们在浏览器中会得到500错误)。 我不得不通过设置log_level来notice这样我才不会错过被警告的严重错误。 同时,我的日志充满垃圾警告从WordPress主题,插件等,我还没有开发,我不想修复更新的原因… 我试了一下,发现php.ini中的log_errors是PHP-FPM获取任何信息所必需的。 但是,来自error_reporting的日志级别似乎也是有线的。 为了testing目的,我使用了以下configuration: display_errors = Off log_errors = On error_log = /proc/self/fd/2 ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR error_reporting […]

Docker for Windows和Symfony 4中的NGINX 502错误网关错误

我试图在Windows机器上使用NGINX和PHP-FPM在Docker中设置Symfony 3。 目前,我得到一个502坏的网关错误。 我将FPM端口从9000更改为8000,因为在我的主机上,端口9000已被超v服务vmms.exe使用。 我不知道是否有关系 泊坞窗,compose.yml version: "3" services: nginx: build: ./nginx volumes: – ./symfony:/usr/shared/nginx/html ports: – "80:80" – "443:443" environment: – NGINX_HOST=free-energy.org depends_on: – fpm fpm: image: php:fpm ports: – "8000:8000" # It seems like FPM receives the full path from NGINX # and tries to find the files in this dock, so it […]

如何设置max_execution_time php-fpm docker镜像?

我使用从https://hub.docker.com/_/php/的 php5.6-fpm的docker图像。 当我检查phpinfo()中的php.ini位置时,它表示它是/ usr / local / etc / php,但是当我查看该path时,没有位于那里的php.ini。 现在我想改变max_execution_time phpvariables。 我怎么能在自定义泊坞窗图像?

如何在Dockerfile中启动PHP7.0-FPM?

通过所有我能find的答案,我似乎无法启动fpm 7.如果我进入容器,我手动运行: service php7.0-fpm start一切工作正常。 我曾经试过的我: CMD ["nginx", "-g", "daemon off;", "php7.0-fpm"] 我曾经试过的二: CMD ["php7.0-fpm", "nginx", "-g", "daemon off;"] 我曾经试过的三: CMD ["php-fpm7.0", "nginx", "-g", "daemon off;"] 我曾经尝试过四: RUN service php7.0-fpm start CMD ["php-fpm7.0", "nginx", "-g", "daemon off;"] PS: Nginx工作正常。 PPS: 如果可能,我想避免使用主pipe。

使用来自Docker容器的PHP sendmail通过主机Postfix发送

嗨,大家好,这里是简单的问题:我想通过我的主机后缀安装发送来自我的Alpine-PHP-Fpm容器的邮件。 重点回顾 PHP-Fpm容器 – > Sendmail – >主机PostFix – >通过SMTP发送 但我得到sendmail: can't connect to remote host (127.0.0.1): Connection refused 这是Postfixconfiguration: smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no append_dot_mydomain = no readme_directory = no smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = MYDOMAIN.com alias_maps = hash:/etc/aliases […]