Git Product home page Git Product logo

wordpress's Introduction

WordPress for Platform.sh

Deploy on Platform.sh

This template builds WordPress on Platform.sh using the johnbolch/wordpress "Composer Fork" of WordPress. Plugins and themes should be managed with Composer exclusively. A custom configuration file is provided that runs on Platform.sh to automatically configure the database, so the installer will not ask you for database credentials. For local-only configuration you can use a wp-config-local.php file that gets excluded from Git.

WordPress is a blogging and lightweight CMS written in PHP.

Features

  • PHP 7.4
  • MariaDB 10.4
  • Automatic TLS certificates
  • Composer-based build

Post-install

  1. Run through the WordPress installer as normal. You will not be asked for database credentials as those are already provided.

  2. This example looks for an optional wp-config-local.php in the project root that you can use to develop locally. This file is ignored in Git.

Example wp-config-local.php:

<?php

define('WP_HOME', "http://localhost");
define('WP_SITEURL',"http://localhost");
define('DB_NAME', "my_wordpress");
define('DB_USER', "user");
define('DB_PASSWORD', "a strong password");
define('DB_HOST', "127.0.0.1");
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

// These will be set automatically on Platform.sh to a different value, but that won't cause issues.
define('AUTH_KEY', 'SECURE_AUTH_KEY');
define('LOGGED_IN_KEY', 'LOGGED_IN_SALT');
define('NONCE_KEY', 'NONCE_SALT');
define('AUTH_SALT', 'SECURE_AUTH_SALT');

Customizations

The following changes have been made relative to WordPress as it is downloaded from WordPress.org. If using this project as a reference for your own existing project, replicate the changes below to your project.

  • It uses the johnbolch/wordpress "Composer Fork" of WordPress, which allow the site to be managed entirely with Composer.
  • The .platform.app.yaml, .platform/services.yaml, and .platform/routes.yaml files have been added. These provide Platform.sh-specific configuration and are present in all projects on Platform.sh. You may customize them as you see fit.
  • An additional Composer library, platformsh/config-reader, has been added. It provides convenience wrappers for accessing the Platform.sh environment variables.
  • The wp-config.php file has been modified to use the Config Reader to configure WordPress based on Platform.sh environment variables if present. If not, your own wp-config-local.php file will be loaded to configure the site for local development.
  • The upstream composer.json file has been modified to include the script movewpconfig. It moves wp-config.php into the default install directory and docroot wordpress after composer install is run.

References

wordpress's People

Contributors

crell avatar chadwcarlson avatar moisesbenzan avatar otaviojava avatar

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.