Setup WordPress
Setup WordPress
This example installs WordPress 6.x from inside the Devilbox PHP container and serves it through a standard Devilbox virtual host.
example wordpress documentation
Overview
The following configuration will be used:
| Project name | VirtualHost directory | Database | TLD_SUFFIX | Project URL |
|---|---|---|---|---|
| my-wp | /shared/httpd/my-wp | my_wp | loc | http://my-wp.loc br https://my-wp.loc |
[!NOTE] Inside the Devilbox PHP container, projects are always in
/shared/httpd/. On your host, projects are stored in./data/www/by default. This path can be changed viaenv-httpd-datadir.
Walk through
It will be ready in seven steps:
- Start Devilbox
- Enter the PHP container
- Create a new VirtualHost directory
- Download WordPress 6.x
- Symlink the webroot directory
- Create the MySQL database and DNS record
- Open WordPress in your browser
1. Start Devilbox
host> ./dvl.sh up2. Enter the PHP container
All work will be done inside the PHP container:
host> ./dvl.sh shell* enter-the-php-container * work-inside-the-php-container *
available-tools
3. Create new vhost directory
The vhost directory defines the name under which your project will be available.
env-tld-suffix
4. Download WordPress 6.x
Use Git to download the current WordPress branch:
[email protected] in /shared/httpd/my-wp $ git clone --branch 6.8 https://github.com/WordPress/WordPress wordpress.gitHow the directory structure looks after installation:
.└── wordpress.git
1 directory, 0 files5. Symlink webroot
The web server expects every project document root in <vhost dir>/htdocs/.
WordPress serves directly from the checkout directory, so symlink it to
htdocs:
.├── wordpress.git└── htdocs -> wordpress.git
2 directories, 0 files6. Database and DNS record
Create the WordPress database:
[email protected] in /shared/httpd/my-wp $ mysql -u root -h 127.0.0.1 -p -e 'CREATE DATABASE my_wp;'If Auto DNS is configured you can skip the hosts entry. Otherwise add this line to your host operating system’s hosts file:
127.0.0.1 my-wp.lochowto-add-project-hosts-entry-on-machowto-add-project-hosts-entry-on-winsetup-auto-dns
7. Open your browser
Open http://my-wp.loc or https://my-wp.loc and follow the WordPress setup:
- Choose a language.
- Enter database name
my_wp, userroot, your database password, and host127.0.0.1. - Run the installation.
- Create the site title and administrator account.
- Log in to the WordPress admin panel.
Next steps
Use bundled batteries
* devilbox-intranet-adminer * devilbox-intranet-phpmyadmin *
devilbox-intranet-phppgadmin * devilbox-intranet-phpredmin *
devilbox-intranet-phpmemcachedadmin
Enhance the Devilbox
* setup-valid-https * setup-auto-dns * configure-php-xdebug
Add services
custom-container-enable-blackfirecustom-container-enable-rabbitmqcustom-container-enable-solrcustom-container-enable-varnish