0

php info.php can triger profiling and write profile file to /tmp/cachegrind.out.* like

-rw-r--r-- 1 roofe www 344 Jul 11 12:04 /tmp/cachegrind.out.6723
-rw-r--r-- 1 root root 7172 Jul 11 12:06 /tmp/cachegrind.out.6808
-rw-r--r-- 1 root root 7178 Jul 11 12:06 /tmp/cachegrind.out.6819

http://example.com/info.php cannot triger profiling

here is the php info

which php
/usr/bin/php
ll /usr/bin/php
lrwxrwxrwx 1 root root 27 May 21 15:14 /usr/bin/php -> /etc/opt/remi/php73/bin/php

I also found all the php process can trig prifiling, while php-fpm not. ps -aef | grep php

root 927 919 1 10:51 ? 00:00:50 /etc/opt/remi/php73/bin/php artisan horizon:supervisor ......
root 948 928 0 10:51 ? 00:00:17 /etc/opt/remi/php73/bin/php artisan horizon:work ........
root 28161 1 0 09:45 ? 00:00:00 php-fpm: master process (/etc/opt/remi/php73/etc/php-fpm.conf)
www 28162 28161 1 09:45 ? 00:01:32 php-fpm: pool www

php.ini

;[xdebug]
zend_extension=/etc/opt/remi/php73/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
xdebug.remote_autostart = On
xdebug.remote_enable = On
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.collect_vars = On
xdebug.collect_return = On
xdebug.collect_params = On
xdebug.profiler_enable= On
xdebug.idekey = PHPSTORM

and nginx conf

location / {
 index /../home/index.html;
 add_header X-Location /;
 try_files $uri /index.php$is_args$args;
 fastcgi_pass unix:/dev/shm/php73-fpm.sock;
 fastcgi_index index.php;
 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 include fastcgi_params;
}
asked Jul 11, 2019 at 7:05
5
  • 1
    General thoughts: 1) Check the actual settings from phpinfo() via browser - maybe it uses different config file etc. (you are not using Apache where it's a common situation, but still) 2) Check for file permission issue (in a folder where those files meant to be created). No other ideas. Commented Jul 11, 2019 at 8:44
  • 1
    Check PrivateTmp in php-fpm unit file (which result in /tmp/being redirect in some sub directory) Commented Jul 11, 2019 at 12:18
  • Path to zend_extension seems very strange..... Commented Jul 11, 2019 at 12:27
  • @RemiCollet It's OK, when I install xdebug, it show me to add this path to config. Commented Jul 12, 2019 at 1:32
  • As you are using php73-php-fpm from my repo, you should also use php73-php-pecl-xdebug from there.... (/opt/remi/php73/root/usr/lib64/php/modules/xdebug.so and /etc/opt/remi/php73/php.d/15-xdebug.ini) Commented Jul 12, 2019 at 5:45

1 Answer 1

6

I think you are affected by PrivateTmp=true in the service unit file:

/usr/lib/systemd/system/php72-php-fpm.service

By default XDebug store profiler file in xdebug.profiler_output_dir=/tmp

You can either disable PrivateTmp or use a directory outside /tmp or /var/tmp

answered Jul 11, 2019 at 12:30

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.