Giter VIP home page Giter VIP logo

Comments (3)

PhilippHeuer avatar PhilippHeuer commented on May 24, 2024

You can configure your local wordpress installation by adding a .env file in the directory root:

# DB Connection
CUSTOM_DB_URL=mysql://user:password@host:3306/databaseName

# WP Settings 
WP_ENV=development
WP_HOME=http://localhost
WP_SITEURL=${WP_HOME}/wp

# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='generateme'
SECURE_AUTH_KEY='generateme'
LOGGED_IN_KEY='generateme'
NONCE_KEY='generateme'
AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'

And then you can run it on any machine you have php installed on with WP CLI:

php wp-cli.phar server --host=localhost --port=80

You may have to install a database server locally, if you do not have any dedicated server and don't want to use heroku's.

Thanks for the issue, missed this part in the documentation.

If this didn't answer your question just respond here - closing it.

from wordpress-heroku.

greyxp avatar greyxp commented on May 24, 2024

Thanks for answer.
Now I have a problem with the database.
When install I choose "heroku addons:create cleardb:ignite"
Locally i have mysql and create new db "wordpress"
My "CUSTOM_DB_URL=mysql://root:root@localhost:3306/wordpress"
When i start local server i have database connection error
https://www.dropbox.com/s/ea71m5y0bc76l61/Screenshot%202017-06-15%2002.27.33.png?dl=0
Maybe I need to do something else to make everything work locally?

from wordpress-heroku.

PhilippHeuer avatar PhilippHeuer commented on May 24, 2024

I tested it locally, which worked fine with MySQL.

This error shows that it can't reach your mysql server at localhost:3306. Are you sure that it's 127.0.0.1 and the port is 3306 and that the service is reachable? Some packages use a non-default port.

It could also be caused by the deprecated mysql extension, since the mysqli extension is missing. Based on this error im guessing that you run PHP 5.5 or 5.6 without the mysqli extension, yes?

You can either install the mysqli extension or upgrade to PHP7 (which i recommend) - Both should fix your issue. Heroku is using PHP7 too.

from wordpress-heroku.

Related Issues (20)

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.