FPM

Combining PHP-fpm with nginx in one dockerfile

空扰寡人 提交于 2020-05-09 19:39:05
问题 I have a need to combine the php-fpm with nginx in one dockerfile for production deployment. So is it better to : (1) Start the dockerfile using php:7.1.8-fpm and then install nginx image layer on top of it ? (2) Or do you recommend using nginx image and then installing php-fpm using apt-get ? PS: I do not have a docker-compose build option for production deployment. On my development environment, I already use docker-compose and build multi-container app easily from two images. Our

Different Php-Fpm containers with Apache

有些话、适合烂在心里 提交于 2019-12-30 14:11:20
问题 my production server is running Docker with a classic structure Db-Container, Server-Container and Php-Fpm container. What i would like to do is to split the sources in order to have different containers for the 3 main parts of the project. Now they work the old way like mydomain.com/index for the main site, mydomain.com/api and mydomain.com/adm for other services. How i have to setup the Apache virtual host in order to map requests like this? mydomain.com -> fcgi://siteFpm:9000 mydomain.com

PHP7.0-FPM with Docker : Unable to load dynamic library OCI8

丶灬走出姿态 提交于 2019-12-25 00:39:21
问题 I have created a Docker Image with PHP7.0-FPM and Apache 2.4. I have installed InstantClient 12.2 (basic + sdk) and I have installed oci8 like this : 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 I don't know why, but I am getting this warning when I (re)start php7.0-fpm : # service php7.0-fpm restart *

understand pm.max_children tuning

孤街浪徒 提交于 2019-12-24 19:57:23
问题 I have done some investigations and I have found this to calculate and adjust pm.max_children value https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/ but for example : I have 8Gb on my server I'm hosting 30 websites php-fpm average process size around 40mb php-fpm max process size around 80mb I want to allocate 5Gb max of my memory to php-fpm processes If I apply this : pm.max_children = Total RAM dedicated to the web server / Max child process size So in my case

CGI、FastCGI、PHP-CGI、PHP-FPM、Spawn-FCGI解析

百般思念 提交于 2019-12-21 22:16:05
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 什么是CGI CGI全称是“公共网关接口/通用网关接口”(Common Gateway Interface),HTTP服务器与你的或其它机器上的程序进行“交谈”的一种工具,其程序须运行在网络服务器上。 CGI可以用 任何一种语言编写 ,只要这种语言具有标准输入、输出和环境变量。如php,python, perl, tcl等 什么是FastCGI   FastCGI(" 快速通用网关接口 ")像是一个常驻(long-live)型的CGI,它可以一直执行着,只要激活后,不会每次都要花费时间去fork一次(这是CGI最为人诟病的fork-and-execute模式)。它还支持分布式的运算, 即FastCGI程序可以在网站服务器以外的主机上执行并且接受来自其它网站服务器来的请求。   FastCGI是语言无关的、可伸缩架构的CGI开放扩展,其主要行为是将CGI解释器进程保持在内存中并因此获得较高的性能。众所周知,CGI解释器的反复加载是CGI性能低下的主要原因,如果CGI解释器保持在内存中并接受FastCGI进程管理器调度,则可以提供良好的性能、伸缩性、Fail-Over特性等等。 FastCGI与CGI特点   1、如CGI,FastCGI也具有语言无关性.   2、如CGI, FastCGI在进程中的应用程序

Can not set error_log option in PHP with ini_set

会有一股神秘感。 提交于 2019-12-20 05:18:10
问题 I'm running PHP 7 on Ubuntu Xenial, and bumped into a weird situation with WordPress. I was attempting to enable WP_DEBUG_LOG and it wasn't writing out to the debug log file. I wrote up a small test case and I can't figure out why this is happening. I do not change the default config for safe_mode or open_basedir which my Googling led me to believe would be the culprits. Script <?php header('Content-Type: text/plain'); define('DEBUG_LOG', '/www/wp-content/debug.log'); echo "PHP Version: " .

PHP-FPM configuration pm = ondemand or dynamic? [closed]

蓝咒 提交于 2019-12-13 10:44:43
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I would like to have your opinion about PHP-FPM configuration and PM variable. static, ondemand or dynamic? Thanks L. 回答1: problem solved and issue explained here : https://serverfault.com/questions/939436/understand-correctly-pm-max-children-tuning 来源: https://stackoverflow

POST-ing to php-fpm increases disk i/o writes

孤者浪人 提交于 2019-12-12 04:08:56
问题 I'm sending POST data about 100KB to my application and it causes php-pfm process to create many pipes and write to disk. I'm wondering how this can be avoided. PID USERNAME VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND 3915 www 6773 298 0 38 0 38 8.86% php-fpm 3932 www 4744 177 0 10 0 10 2.33% php-fpm 3753 www 4522 157 0 52 0 52 12.12% php-fpm 3910 www 3551 166 0 51 0 51 11.89% php-fpm 3934 www 4169 207 0 45 0 45 10.49% php-fpm 3989 www 3183 152 0 13 0 13 3.03% php-fpm 3844 www 4176 134

Nginx + php fastcgi showing “No input file specified.” instead of 404

狂风中的少年 提交于 2019-12-12 01:52:43
问题 My problem i quite simple. When I request a .php file that doesn't exist, I see "No input file specified.", instead of the 404 page that you would expect. I get that i am passing all requests with the .php extension to php-fpm, and i guess that php-fpm returns "No input file specified." when the file does not exist(?). How do i fix this? /etc/nginx/nginx.conf: http { server { listen 443 ssl; server_name smarthome.dk; ssl_certificate /home/www/SmartHome/cert/ssl.crt; ssl_certificate_key /home

move_uploaded_file creating unaccessible (403 forbidden) files under nginx

自闭症网瘾萝莉.ら 提交于 2019-12-12 01:15:39
问题 I've created a simple upload script in php that takes a file submitted from a form and puts it in the desired directory. The problem is that, for some reason, when you try to show this file in the browser, the server answers with a 403 - Forbidden message. In fact I modified the script so it first makes a copy of the file from the tmp folder and then moves it with a different name: copy($_FILES['photo']['tmp_name'],$new_file_name); move_uploaded_file($_FILES['photo']['tmp_name'], 'm_'.$new