Closed achton closed 8 years ago
To fix it you need to add libapache2-mod-php5
in extra_packages
. https://github.com/geerlingguy/drupal-vm/issues/387#issuecomment-173291158
@geerlingguy for DX purposes what about simply adding the package to the example config? I've had two developers from our team ask me about it already :) It would be nice to support both fpm
and mod_php
out of the box. I understand that you don't want to add it to the apache role, but it would be a nice high level feature for Drupal VM.
@oxyc Thanks for the feedback. I thought that might have been an intermediate step when upgrading from 2.1.x to 2.2.0. In my case, this is a freshly built box.
In any case, without the mod-php5
package, I cannot see how the box can run with FPM disabled?
@achton - My goal with 2.2.0 (and beyond) is to support primarily the FPM-only use case, as it's:
If a compelling argument can be made to preserve (and default to) mod_php support, I may consider semi-reverting my stance and adding libapache2-mod-php5
to example.config.yml extra packages, but as it is, I want to keep pushing people towards best practices with the defaults for Drupal VM.
You have to install libapache2-mod-php5
if you use a Debian/Ubuntu base box to get mod_php
support. Note that on CentOS, you don't need to do so, as mod_php is already included with the base Apache packages.
@geerlingguy Thanks for the quick response. In our case, we are indeed transitioning to FPM on our hosting platform. But until that change has been completed by our Ops department, I want to keep using mod_php as that is the current method. So on the long term, I also think that a FPM-only setup is the way to go.
I just needed a bit of guidance on how to continue here, which I have now, thanks. Also, I think this is a duplicate of #387.
Another thing: it seems that switching between FPM and non-FPM is not supported by the provisioning scripts? At least I find that I have to destroy/rebuild while testing these changes to get back to a working box.
If you have mod_php installed, I think you can just leave PHP-FPM running and choose to switch between it and mod_php using the ProxyPass extra param as shown in example.config.yml, right?
When running apt-get install
manually it prompts about what to do with the current configuration files. Might be why a re-provision doesn't work after adding libapache2-mod-php5
.
I'd still vote for using FPM by default but having mod_php installed so developers can swap them more easily. I'm guessing everyone does exactly what @achton did, and then comes here to try and figure out why it doesnt work. Having to install an extra package isn't immediately obvious.
[Edit: whoops, hit the wrong button].
One issue I have with adding the package the the default extra_packages is that this will be yet another thing that has to be edited for the box to provision correctly if someone switches to the centos6 or centos7 base box.
It seems it's mostly just a communication issue... though I don't have anything more than the release notes (e.g. https://github.com/geerlingguy/drupal-vm/releases/tag/2.2.0) to communicate the need to change an existing config.
Hmm yeah that's not ideal either.
Maybe for the next few releases keep a comment about adding the package here (like a deprecation notice): https://github.com/geerlingguy/drupal-vm/blob/master/example.config.yml#L189
I'm guessing everyone who wants to swap look at that particular line.
@oxyc - Good idea. We'll leave it in until we take it out :)
Trying to run 2.2.0 without FPM, but with a few other tweaks to the example config. When I access any PHP application (including adminer etc) in my browser, I am just served the code as plain text. It seems there is no php module available to apache:
Here is my config (as a diff from
example.config.yml
):