Skip to content

Instantly share code, notes, and snippets.

@liwo
Created November 5, 2019 17:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liwo/807106b9577087380152bd8bf8bd3012 to your computer and use it in GitHub Desktop.
Save liwo/807106b9577087380152bd8bf8bd3012 to your computer and use it in GitHub Desktop.
Tideways Xhprof error in FPM setup
version: '3'
services:
php:
build: .
ports:
- "9000:9000"
volumes:
- .:/var/www/html/
nginx:
image: nginx:latest
ports:
- "8080:80"
volumes:
- .:/usr/share/nginx/html/
- ./nginx.conf:/etc/nginx/conf.d/default.conf
links:
- php
FROM php:7.1.30-fpm-buster
#FROM php:7.3.11-fpm-buster
RUN sed -ie 's/pm.max_children = 5/pm.max_children = 1/;s/pm.start_servers = 2/pm.start_servers = 1/;s/pm.max_spare_servers = 3/pm.max_spare_servers = 1/' /usr/local/etc/php-fpm.d/www.conf
ADD https://github.com/tideways/php-xhprof-extension/releases/download/v5.0.1/tideways-xhprof_5.0.1_amd64.deb /root/tideways-xhprof_5.0.1_amd64.deb
RUN dpkg -i /root/tideways-xhprof_5.0.1_amd64.deb
RUN echo 'php_admin_value[extension] = /usr/lib/tideways_xhprof/tideways_xhprof-7.1.so' >> /usr/local/etc/php-fpm.d/www.conf
#RUN echo 'php_admin_value[extension] = /usr/lib/tideways_xhprof/tideways_xhprof-7.3.so' >> /usr/local/etc/php-fpm.d/www.conf
<?php
tideways_xhprof_enable(TIDEWAYS_XHPROF_FLAGS_CPU | TIDEWAYS_XHPROF_FLAGS_MEMORY);
phpinfo();
server {
root /usr/share/nginx/html;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/www/html$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment