-
-
Notifications
You must be signed in to change notification settings - Fork 864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable use of (additional) ini files for workers when restarted by XdebugHandler #5809
Comments
This bug report is missing a link to reproduction on phpstan.org. It will most likely be closed after manual review. |
Related PR: phpstan/phpstan-src#726 |
This issue is a result of phpstan/phpstan-src#559 which adds code to allow the user to pass a custom ini file on the command-line so that it can be used in a worker process: Unfortunately it overlooked xdebug-handler, which has been configured to use its standard restart strategy (https://github.com/composer/xdebug-handler#process-configuration). This results in xdebug being loaded in the worker process - which triggers another restart. In these situations it is much better to use the persistent settings restart: $xdebug = new XdebugHandler();
$xdebug->setPersistent();
$xdebug->check();
unset($xdebug); Not only will it fix this particular error, but it saves additional restarts and offers much more flexibility should you want to invoke a sub-process with xdebug from a restarted xdebug-free environment (https://github.com/composer/xdebug-handler#setpersistent). |
I guess Persistent uses the PHP_INI_SCAN_DIR Environment Variable - this will also resolve the Issue. |
https://github.com/composer/xdebug-handler#persistent-settings It's all covered in some detail in the docs. |
Should be fixed by: phpstan/phpstan-src@222e1c3 Please verify that it works by trying out |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
I'am using phpstan:master.
I'a getting error messages like:
Relates to: composer/xdebug-handler#137
Internal worker errors when restarted by XdebugHandler and compiled with
--with-config-file-scan-dir
I'am using php in a standard docker container
FROM php:7.4-fpm
which is compiled with--with-config-file-scan-dir
Phpstan is missing the
-n
flag on it's workers which could explain the problem because workers should not get restarted when xdebug is already disabled:When phpstan would include the
-n
-Flag there also would be less processes:This was achieved by adding this code to:
https://github.com/phpstan/phpstan-src/blob/2c1107588603afaa8cd3e97165b7eb1736cb4393/src/Process/ProcessHelper.php#L29
The text was updated successfully, but these errors were encountered: