hashbangcode / vlad

Vlad - Vagrant LAMP Ansible Drupal
173 stars 53 forks source link

Remove Don't populate `auto_prepend_file` in default php.ini #98

Closed weitzman closed 9 years ago

weitzman commented 9 years ago

When I add the querystring for xhprof, I am seeing a redirect to the same url without _profile=1 on it. Is this a feature? If you want to profile multiple pages this is inconvenient.

weitzman commented 9 years ago

I should add that this happens when I make a request like http://drupal.local:8080/?_profile=1 and when I omit the 8080.

weitzman commented 9 years ago

The redirect seems to happen in /var/www/xhprof_html/external/header.php. That gets included via auto_prepend_file in php.ini. IMO, we should not be including this file in every request. It seriously gets in the way when trying to debug via Xdebug. I tried with both PHPstorm and Komdo. They both want a path mapping for header.php but that file is not in the docroot.

weitzman commented 9 years ago

Actually , auto_prepend_file is set in a vhost. I tracked this down to vlad/playbooks/roles/xhprof/tasks/xhprof.yml.

philipnorton42 commented 9 years ago

Xhprof on it's own does nothing, you need to include another package to handle the requests and generate the data/graphs etc. The two most commonly used tools to do this are Xhgui and XHProf UI. I used XHProf UI in Vlad as Xhgui requires MongoDB, which I've not included in the system (yet). Both of these tools require the inclusion of a header file using the auto_prepend_file directive. Without this in place the system would not be able to record any information and would do nothing. I agree that it's a little annoying that IDE's mess about with the file, but I've been able to turn off this feature in PHPStorm.

We could easily remove the gui system and perhaps switch to a Drupal based solution like the XHProf module (https://www.drupal.org/project/XHProf). I've not tested this module yet but it's worth looking into. I'll give it a shot and see what happens.

philipnorton42 commented 9 years ago

The xhprof Drupal module works for the most part, it's not as good as the other gui tools available, but it does produce the stats.

I think a better solution might be to split apart xhprof and xhprofgui into separate roles. That way xhprof can be installed without then also installing the xhprofgui component which is the offending bit in this issue.

That said, xhprof is turned on by default. Maybe we should turn it off by default and put a warning in the settings.yml file about this issue?

dixhuit commented 9 years ago

I keep meaning to question whether xhprof should be enabled by default - it's always made me wonder. I don't think it should be.

philipnorton42 commented 9 years ago

Cool. Lets leave it as it is and turn it off as a default :)

philipnorton42 commented 9 years ago

Pushed a change for the settings file to dev.

weitzman commented 9 years ago

Works for me. Thanks guys.

philipnorton42 commented 9 years ago

I'm going to close this for now with the understanding that we add stuff to the documentation (being written) that describes this setup.