Skip to content
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

Allow disabling xdebug for CLI SAPI on Debian/Ubuntu. #54

Merged
merged 1 commit into from
Oct 25, 2017

Conversation

thom8
Copy link
Contributor

@thom8 thom8 commented Sep 16, 2017

Fixes #53

@danepowell
Copy link

Sweet... I'm not an expert at Ansible configuration but this looks good to me!

@danepowell
Copy link

If anyone wants to test this on a live DrupalVM-based project, here's a patch you can apply against DrupalVM via composer:
ansible-role-php-xdebug-54.patch.txt

I've implemented it and it works great, and does seem to boost CLI performance about 30%.

@thom8
Copy link
Contributor Author

thom8 commented Sep 26, 2017

I get around this issue by running all CLI commands on the host (with xdebug disabled) which is faster again.

@@ -17,3 +17,5 @@ php_xdebug_idekey: sublime.xdebug

php_xdebug_max_nesting_level: 256

# Only used on Debian/Ubuntu.
php_xdebug_cli_disable: no
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be willing to add this in Debian/Ubuntu-specific without something similar for Red Hat/etc... but I want to try to make it an equitable option for CentOS users at least. If nobody else can take a crack at it, I will soon, I just don't have the time tonight.

Copy link

@danepowell danepowell Oct 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this would be possible on CentOS without substantial changes to how PHP is invoked.

I've never worked with CentOS before, but after a brief investigation it appears that PHP config files can't distinguish between different execution contexts (CLI vs FPM) like they can on Ubuntu. Instead, you'd have to pass a unique CLI-specific configuration file as an argument to php, which seems like a pretty big change just to support this one use case.

A brief Google seems to confirm this: https://gagor.pl/2014/05/changing-default-php-ini-file-for-php-cli-on-centos/

@danepowell
Copy link

This is pretty hard to work around downstream, so I'd love to get this merged. Maybe we can open a follow up issue to support additional OSes if it's not going to be quick/easy?

@geerlingguy geerlingguy merged commit 9538df6 into geerlingguy:master Oct 25, 2017
@geerlingguy
Copy link
Owner

Merged! It's probably not feasible to try to get it working on RHEL derivatives in a similar fashion.

@thom8 thom8 deleted the disable_cli branch October 25, 2017 20:29
@thom8
Copy link
Contributor Author

thom8 commented Oct 25, 2017

@geerlingguy came to the same conclusion here -- geerlingguy/ansible-role-php#140 (comment)

Only looked at the default config but there might be a package which adds support for separate config per SAPI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants