cloudfoundry / php-buildpack

A Cloud Foundry Buildpack for PHP.
Apache License 2.0
142 stars 347 forks source link

Cleaner httpd conf extension proposal #310

Closed mogul closed 5 years ago

mogul commented 5 years ago

IN ORDER TO ensure my PHP application will pick up changes in the PHP buildpack's default configuration when new versions are released, AS A PHP buildpack user I WANT a way to extend the httpd conf without overwriting buildpack-provided conf files.

This is in reference to the docs here, which recommend copying the httpd.conf (or another file) from the buildpack source, modifying it to add inclusion of special configuration, and adding it to the .bp-config directory. When users do that, it means they have to start watching the file upstream that they overrode for changes, or risk breakage in their app.

Adding a single IncludeOptional line (with an expected directory name) to httpd.conf would make it trivial to extend the httpd conf without overwriting buildpack-provided files. Here's an example where I did that: https://github.com/18F/cf-ex-drupal8/pull/25

cf-gitbot commented 5 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/166706965

The labels on this github issue will be updated when the story is started.

dmikusa commented 5 years ago

👍 This would be a nice convenience feature and it's basically a one-line change to the default httpd.conf file in the buildpack (to add this.

I have thought about doing this in the past and just never got around to it. Mostly because the config that's in the buildpack rarely changes. Anyway, +1.

dfreilich commented 5 years ago

@dmikusa-pivotal Should I leave this here, or port it over to the httpd-cnb?

dmikusa commented 5 years ago

@dfreilich - I don't think this would apply for the httpd-cnb because that is not generating any configuration, it just uses exactly what the user provides.

This is a small change so I would support making it for the current PHP buildpack. I think it should also be added to the php-web-cnb issue log so that we can make sure the configuration being generated by that CNB to run PHP apps is flexible and able to be extended.

ForestEckhardt commented 5 years ago

For php-web-cnb it is now possible to include custom http snippets. This should be easier than the current behavior in the php-buildpack because you no longer have to override the complete file. This approach is also inline with how we override php.ini and php.fpm.