wordpress using nginx php mysql on macos
🧰 Prerequisites (via Homebrew)
Open Terminal and install the essentials:
Start services:
Optional: You can check versions with
nginx -v,mysql --version,php -v.
🗃️ Create a MySQL Database for WordPress
Then inside MySQL shell:
📥 Download and Place WordPress
You now have the site files in:
/usr/local/var/www/wordpress.local
🔧 Configure Nginx
Nginx config lives at:
To avoid cluttering the main file, add a new server config in:
If servers directory doesn't exist yet:
Then create the config file:
Paste this:
Then include this directory in your nginx.conf:
Edit /opt/homebrew/etc/nginx/nginx.conf, and inside the http {} block, make sure this is there:
🧠 Map Domain to Localhost
Edit /etc/hosts:
Add:
🔁 Restart Nginx
🚀 Final Step: Visit in Browser
Go to:
http://wordpress.local
You’ll see the WordPress installation screen. Use:
-
DB Name:
wordpress -
Username:
wpuser -
Password:
wppassword -
DB Host:
localhost
And that’s it! WordPress will finish installing and you’ll be ready to develop locally.
Comments
Post a Comment