PHP code example of tinywan / webman-xhprof

1. Go to this page and download the library: Download tinywan/webman-xhprof library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tinywan / webman-xhprof example snippets


composer 

[xhprof]
extension=xhprof.so;
xhprof.output_dir=/tmp/xhprof;

return [
    '' => [
        \Tinywan\Xhprof\XhprofMiddleware::class,
    ]
];
javascript
wget https://pecl.php.net/get/xhprof-2.3.9.tgz
tar -zxvf xhprof-2.3.9.tgz
cd ./xhprof-2.3.9/extension
phpize
./configure --with-php-config=/usr/local/php-7.4/bin/php-config
make
make install
javascript
/var/www # php --ri xhprof

xhprof

xhprof support => enabled
Version => 2.3.9

server {
    server_name webman.xhprof.com;

    root /var/www/webman-admin/vendor/tinywan/webman-xhprof/src;

    location / {
        if (!-e $request_filename) {
            rewrite ^(.*)$ /index.php?s=/$1 last;
        }
    }

    location ~ \.php(.*)$ {
        try_files $fastcgi_script_name =404;

        fastcgi_pass php74:9000;
        fastcgi_index index.php;
        fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;