ianchanning / wp-insella
Composer version of WordPress-Skeleton
Requires
- php: >=5.3.0
- fancyguy/webroot-installer: 1.0.0
- wordpress: 4.9.6
README
Based on WordPress Skeleton but replacing Git Submodules with Composer.
In sella is Italian for 'in the saddle' and was initially used for http://insella.co.uk.
This tries to make the benefits of WordPress Skeleton available for a wider audience:
- This readme should get you fully started with WordPress installed and uploads working
- Composer in my view is easier to understand than learning about Git Submodules
- Composer should be able to install on hosts that don't have Git
- I agree with the idea that Composer is a more appropriate tool to use than Git Submodules
- The directory structure remains compatible with WordPress Skeleton, so you should be able to mix in the extra WordPress Skeleton goodies when you get to them
- There's a separate
wp-config-skeleton.php
file so that you don't have to fork this repo which makes it easier to get WordPress updates - This is a Composer Package so instead of cloning you can call
composer create-project ianchanning/wp-insella .
in your httpdocs directory - It still encourages local development with the
local-config.php
file and allows all the other great stuff you can do with WordPress-Skeleton
This setup relies on having SSH access and running the PHP commands to install composer on your webserver.
If you don't have Git on your webserver, follow the No git and no composer setup section below. There's a Media Temple installation guide at the bottom as that happens to be what I'm using.
Quick start
Skip this section if you don't have git or composer installed.
cd your/httpdocs/dir git clone https://github.com/ianchanning/wp-insella . composer install cp wp-config-skeleton.php wp-config.php
Create your database and edit wp-config.php
with your database config and salts.
Configuration
Then go to http://www.example.com/wp/wp-admin/ - beware of going directly to www.example.com as it will try going to http://www.example.com/wp-admin which misses out the wp
directory and ends up in an infinite redirect.
Once WordPress is installed, go to Settings | General and change the Site Address (URL) to http://www.example.com
Uploads
WordPress Skeleton suggests that you should only use the 'shared' directory for uploads locally. Given that we're not using capistrano we'll keep the directory structure the same but just use the shared directory in production.
cd your/httpdocs/dir
mkdir -p shared/content/uploads
Make sure uploads directory is writable by your webserver.
Future updates
- I'll update, commit and push the
composer.json
file to https://github.com/ianchanning/wp-insella - On your site:
cd your/httpdocs/dir
git pull
composer update
No git and no composer setup
This is assuming that you have the most basic web host that doesn't allow anything except SSH / PHP / MySQL.
Database
Using your hosting admin:
- Create the MySQL database
- Create a database user
- Give the database read and write access on the database
- Have the details handy
Composer
From the main composer installation guide, I'm going to assume that you probably don't have the rights to install it globally so we'll install it locally. N.B. the -d allow_url_fopen=On
which is to modify one of the php.ini settings which may be turned off by your host (e.g. Media Temple)
Log in via SSH. Install composer in the httpdocs
parent directory and httpdocs
must be empty.
cd your/httpdocs/dir cd .. php -r "readfile('https://getcomposer.org/installer');" | php -d allow_url_fopen=On
WordPress
php -d allow_url_fopen=On composer.phar create-project ianchanning/wp-insella [httpdocs] cp wp-config-skeleton.php wp-config.php
This should set up the entire WordPress Skeleton installation and the wp
directory with all the WordPress files.
Edit wp-config.php
with your database config and salts.
Follow the above WordPress database installation / configuration and Create the shared uploads directory sections above.
Future updates
- I'll update, commit and push the
composer.json
file to https://github.com/ianchanning/wp-insella - Download https://raw.githubusercontent.com/ianchanning/wp-insella/master/composer.json
- FTP it to your httpdocs directory and overwrite the
composer.json
- Run
php -d allow_url_fopen=On ../composer.phar update
Media Temple (Grid Service) installation
Database
In media temple admin go to:
- Create a database
- Create a database user
- Give the user permission on the database
Composer
Composer can't be installed globally so it has to be installed locally. Based off this guide:
Login via SSH, this assumes that your html
directory is empty. You will get warnings when you install comopser, but it should still install correctly.
cd domains/example.com curl -sS https://getcomposer.org/installer | php -d allow_url_fopen=On
WordPress
cd html git clone https://github.com/ianchanning/wp-insella . php -d allow_url_fopen=On ../composer.phar install cp wp-config-skeleton.php wp-config.php
This should set up the entire WordPress Skeleton installation and the wp
directory with all the WordPress files.
Edit wp-config.php
and change the database settings to (N.B. the DB_HOST
isn't localhost):
define( 'DB_NAME', 'dbXXXXXX_[your domain]' ); define( 'DB_USER', 'dbXXXXXX_[your domain]' ); define( 'DB_PASSWORD', 'xkcd.com/936' ); define( 'DB_HOST', $_ENV['DATABASE_SERVER'] );
Update the salts.
Follow the above WordPress database installation / configuration and Create the shared uploads directory sections above.
Future updates
- I'll update, commit and push the
composer.json
file to https://github.com/ianchanning/wp-insella - On your site:
cd domains/example.com/html
git pull
php -d allow_url_fopen=On ../composer.phar update