GithubHelp home page GithubHelp logo

php-httpd's Introduction

PHP HTTPD Cloud Native Buildpack

A Cloud Native Buildpack for configuring HTTPD settings for PHP apps.

The buildpack generates the HTTPD configuration file with the minimal set of options to get HTTPD to work, and incorporates configuration from users and environment variables. The final HTTPD configuration file is available at /layers/paketo-buildpacks_php-httpd/php-httpd-config/httpd.conf, or locatable through the buildpack-set $PHP_HTTPD_PATH environment variable at launch-time.

Integration

The PHP HTTPD CNB provides php-httpd-config, which can be required by subsequent buildpacks. In order to configure HTTPD, the user must declare the intention to use HTTPD as the web-server by setting the $BP_PHP_SERVER environment variable to httpd at build-time.

pack build my-httpd-app --env BP_PHP_SERVER="httpd"

HTTPD Configuration Sources

The base configuration file generated in this buildpack includes some default configuration, and an IncludeOption section for user-included configuration.

User Included Configuration

User-included configuration should be found in the application source directory under <app-directory>/.httpd.conf.d/*.conf. If a file at this path exists, it will be included in an IncludeOptional section at the bottom of the generated HTTPD configuration.

Environment Variables

The following environment variables can be used to override default settings in the HTTPD configuration file.

Variable Default
BP_PHP_SERVER_ADMIN admin@localhost
BP_PHP_ENABLE_HTTPS_REDIRECT true
BP_PHP_WEB_DIR htdocs

Usage

To package this buildpack for consumption:

$ ./scripts/package.sh

This builds the buildpack's Go source using GOOS=linux by default. You can supply another value as the first argument to package.sh.

Run Tests

To run all unit tests, run:

./scripts/unit.sh

To run all integration tests, run:

./scripts/integration.sh

Debug Logs

For extra debug logs from the image build process, set the $BP_LOG_LEVEL environment variable to DEBUG at build-time (ex. pack build my-app --env BP_LOG_LEVEL=DEBUG or through a project.toml file.

php-httpd's People

Contributors

arjun024 avatar dependabot[bot] avatar joshuatcasey avatar paketo-bot avatar robdimsdale avatar ryanmoran avatar sophiewigmore avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

joshuatcasey

php-httpd's Issues

Restructure buildpack: Create php-httpd buildpack

Context

blocked on RFC merging

Issue #2 was previously opened to create the PHP HTTPD buildpack. Since then, the scope of responsibility for this buildpack has been cut down. Changes to this buildpack are explained in paketo-buildpacks/rfcs#158.

This buildpack will now be responsible solely for creating the HTTPD configuration file, and making it available to downstream buildpacks (the future PHP Start buildpack). This makes the buildpack simpler and more maintainable.

Issue

This issue is to add a new buildpack, named php-httpd, which will be responsible for setting up HTTPD config.

Logic to support the HTTPD conf setup currently lives within the PHP Web buildpack and should be moved into this new buildpack. This includes support for some user-provided configuration.

  • API: The buildpack should provide httpd-config and require none

  • The buildpack will be responsible for generating an httpd.conf file

  • In order for this buildpack to pass detection, users must declare their intention to use HTTPD as their server through the BP_PHP_SERVER environment variable.

  • Packit: This buildpack should be written using the packit library.

  • Buildpack API Version: This buildpack should be written using Buildpack API 0.7

  • Add a [[buildpack.licences]] section to the buildpack.toml.

  • README: Make sure a README is added that conveys context about the buildpack in a manner consistent with other Paketo buildpacks.

Acceptance

  1. I can successfully build and ping a PHP app that uses HTTPD web server such as the Paketo PHP Httpd sample app, with the Paketo HTTPD CNB, this new buildpack, the Paketo Procfile CNB (to set the HTTPD start command), and the Paketo Community Build Plan CNB (to require httpd-config at launch-time). Debug logs from the build should show that any user-set configuration is used in creation of the configuration file.

Restructure buildpack: Create php-httpd buildpack

Context

Per PHP RFC 0001 we are restructuring the PHP language family of buildpacks to make them more modular, up-to-date, and as a result, maintainable.

Currently, the PHP Web buildpack is responsible for configuring and running PHP applications across built-in PHP servers, HTTPD, NGINX, as well as supporting FPM process managers. The goal of this issue is to separate the concerns within PHP Web into individual buildpacks.

Issue

This issue is to add a new buildpack, named php-httpd, which will be responsible for setting up HTTPD to serve PHP applications. This issue is blocked on https://github.com/paketo-buildpacks/php/issues/476.

Logic to support the HTTPD server setup currently lives within the PHP Web buildpack and should be moved into this new buildpack.

  • API: The buildpack should provide none and require php, require php-fpm, and require httpd at launch-time.

  • The buildpack will be responsible for generating an httpd.conf file

  • It is also responsible for setting the start command of type web to start the HTTPD server, as well as PHP FPM.

  • In order for this buildpack to pass detection, users must declare their intention to use HTTPD as their server. Following paketo-buildpacks/php#472, an option besides buildpack.yml should be enumerated to cover this case.

  • Packit: This buildpack should be written using the packit library.

  • Buildpack API Version: This buildpack should be written using Buildpack API 0.7

  • Add a [[buildpack.licences]] section to the buildpack.toml.

  • README: Make sure a README is added that conveys context about the buildpack in a manner consistent with other Paketo buildpacks.

  • Direct processes: Use direct processes and exec.d where applicable.

This issue can be transferred to the appropriate repository (paketo-buildpacks/php-httpd), once it has been created.

Acceptance

  1. I can successfully build a PHP app that uses an HTTPD such as the Paketo PHP Httpd sample app, with PHP Dist, the new PHP-FPM buildpack, the HTTPD buildpack, this new PHP HTTPD buildpack, and see logs that show the app is run with the HTTPD server and starts FPM. I can also run the container and curl the app and see Powered By Paketo Buildpacks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.