When deploying a fresh (ssl) site to production server, I receive a PHP notice and an error establishing a database. Not sure if I made a mistake somewhere or if it’s a bug.
I’m on the latest Trellis and Bedrock.
TASK [deploy : WordPress Installed?] *******************************************
System info:
Ansible 2.2.0.0; Linux
Trellis at "Add myhostname to nsswitch.conf to ensure resolvable hostname"
---------------------------------------------------
PHP Notice: Constant DISALLOW_FILE_EDIT already defined in /srv/www/mysite
.nl/releases/20161121125004/config/application.php on line 76
Error: Error establishing a database connection. This either means that the
username and password information in your `wp-config.php` file is incorrect
or we can’t contact the database server at `localhost`. This could mean your
host’s database server is down.
fatal: [my.ip.address]: FAILED! => {"changed": false, "cmd": ["wp", "core",
"is-installed"], "delta": "0:00:00.180013", "end": "2016-11-21 12:50:23.097210",
"failed": true, "failed_when_result": true, "rc": 1, "start": "2016-11-21
12:50:22.917197", "stderr": "PHP Notice: Constant DISALLOW_FILE_EDIT
already defined in /srv/www/mysite.nl/releases/20161121125004/config/application.php
on line 76\nError: Error establishing a database connection. This either
means that the username and password information in your `wp-config.php` file
is incorrect or we can’t contact the database server at `localhost`. This could
mean your host’s database server is down.", "stdout": "", "stdout_lines":
[], "warnings": []}
wordpress_sites.yml:
mysite.nl:
site_hosts:
- canonical: mysite.nl
redirects:
- www.mysite.nl
local_path: ../sites/mysite.nl # path targeting local Bedrock site directory (relative to Ansible root)
repo: git@gitlab.path # replace with your Git repo URL
# repo_subtree_path: site # relative path to your Bedrock/WP directory in your repo
branch: master
multisite:
enabled: false
ssl:
enabled: true
provider: letsencrypt
cache:
enabled: true
env:
wp_home: https://mysite.nl
wp_siteurl: https://mysite.nl/wp