Source:
The steps for installing mongodb server, the PECL mongodb PHP extension (which is called mongodb
, not the legacy mongo
), xhprof need to be peformed on the docker container runnning php-fpm.
The steps for configuring the web server for xhgui are to be performed on the container running the web server.
Both containers (nginx and php-fpm) need to share the server root /var/www
in which the web app and the xgui app needs to be located.
Note: This only work for PHP 5+. For PHP 7+ replace the xhprof PHP extension with tideways_xhprof PHP extension.
Problem 1 - alcaeus/mongo-php-adapter 1.0.0 requires mongodb/mongodb ^1.0.1 -> satisfiable by mongodb/mongodb[1.0.1, 1.0.2].
resolution:
Server at localhost:27017 reports wire version 0, but this version of libmongoc requires at least 3 (MongoDB 3.0): generic server error
resolution:
WARNING: [pool www] child 5 said into stderr: "NOTICE: PHP message: xhgui - invalid document for insert: keys cannot contain ".": "main()==>load::webroot/index.php""
resolution :
404 Error on
/run/view?id=5b33e6e29825e900064b6a66
Resolution: perftools/xhgui#196
server {
listen 80;
server_name xhgui.example.com;
root /var/www/xhgui/webroot/;
index index.php;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
in your web-app's Nginx virtualhost config, add:
fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/xhgui/external/header.php";
Example:
server {
...
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "auto_prepend_file=/var/www/xhgui/external/header.php";
include fastcgi_params;
}
...
}