Is anyone familiar with Craft CMS?
Installation Process: https://docs.craftcms.com/v3/installation.html#step-1-download-craft
I tried installing it through MAMP (not MAMP PRO), but I can’t get past Step 6.
When I try to access http:///index.php?p=admin/install, the page displays
Database Connection Error – craft\errors\DbConnectException
Craft CMS can’t connect to the database with the credentials in config/db.php.
I’m sure that the values match what’s in my database and that the page is loading the db.php I’m working on. Here’s what’s in my db.php.
return [ 'driver' => getenv('DB_DRIVER'), 'server' => getenv('localhost'), 'user' => getenv('craft'), 'password' => getenv('jC8M4MEa38s7OrM4'), 'database' => getenv('craft'), 'schema' => getenv('DB_SCHEMA'), 'tablePrefix' => getenv('craft'), 'port' => getenv('DB_PORT') ];
And here’s my .env
# The environment Craft is currently running in ('dev', 'staging', 'production', etc.) ENVIRONMENT="dev" # The secure key Craft will use for hashing and encrypting data SECURITY_KEY="F2zBz*4kyCxaH"$r" # The database driver that will be used ('mysql' or 'pgsql') DB_DRIVER="mysql" # The database server name or IP address (usually this is 'localhost' or '127.0.0.1') DB_SERVER="localhost" # The database username to connect with DB_USER="root" # The database password to connect with DB_PASSWORD="root" # The name of the database to select DB_DATABASE="craft" # The database schema that will be used (PostgreSQL only) DB_SCHEMA="public" # The prefix that should be added to generated table names (only necessary if multiple things are sharing the same database) DB_TABLE_PREFIX="" # The port to connect to the database with. Will default to 5432 for PostgreSQL and 3306 for MySQL. DB_PORT=""
I’m a beginner in PHP and I have no idea what is the problem here. I tried changing other possible values for server, user and password, but no luck.
Can someone give me any idea on how I can fix this one? Thanks!