rentsetr.blogg.se

Php mysql for mac
Php mysql for mac






  1. PHP MYSQL FOR MAC INSTALL
  2. PHP MYSQL FOR MAC PRO

Replace YOUR_USERNAME with your local username. $ sudo cp /opt/homebrew/etc/php/7.4/php-fpm.d/Now let’s edit /private/etc/php-fpm.d/Under the section that says “ Unix user/group of processes” make sure to have these two lines: user = YOUR_USERNAME Now do: $ sudo mkdir /private/etc/php-fpm.d In the error log section of the new file, add error_log = /private/var/log/php-fpm.log and create that file. $ sudo cp /opt/homebrew/etc/php/7.4/nf /private/etc We should see the location of the default config file which we will copy and then edit. Open your terminal app and run: $ php-fpm -t Configure php-fpmįirst, let’s double check to see where the nf default file is located. If you encounter any errors, you can always run $ sudo nginx -t to test the nginx config and Google any errors or warnings (or post in the comments below). The files should be saved to /opt/homebrew/etc/nginx/nf, /opt/homebrew/etc/nginx/servers/nf, and /opt/homebrew/etc/nginx/servers/nf.Īfter doing that, restart nginx: $ sudo brew services restart nginx The top two comments in each file there include instructions. To save time, I pasted the files I use to configure these here:

php mysql for mac

Using your favorite text editor, we now need to setup the nginx config for our system, for phpmyadmin, and for each of our development sites. Now use your web browser to visit and you should see the “Welcome to nginx!” message. If everything looks good then run: $ brew services start nginx If you see any error messages or warnings then you should Google them and adjust your nginx config file accordingly (by default it’s /opt/homebrew/etc/nginx/nf). Open your terminal app and run: $ sudo nginx -t You can now use the mysql user admin to connect to any database.Įdit /opt/homebrew/etc/my.cnf and add these two lines to the bottom: character-set-server=utf8įirst, let’s check to make sure the default config is working properly. Open your terminal app and run: $ mysql -uroot -p Now we’ll create an admin user for mysql that can access all of the databases. Open your terminal app and run: $ brew services start mysqlĬomplete the mysql_secure_installation the default pass is empty for root, follow instructions (should be able to just hit enter for each prompt). If it doesn’t work right away, try turning WiFi off and on (or unplug/plug your ethernet cable), or reboot your system. The results should return from the IP address 127.0.0.1. To test the dnsmasq setup, open your terminal app and run: $ ping -c 3 fakedomainthatisntreal.localhost $ sudo bash -c 'echo "port 35353" > /etc/resolver/dev' $ sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'

php mysql for mac

Open your terminal app and run: $ echo 'address=/.dev/127.0.0.1' > $(brew -prefix)/etc/nf Open your terminal app and run: $ mkdir ~/Sites

PHP MYSQL FOR MAC INSTALL

Open your terminal app and run: $ brew install nginx mysql phpmyadmin dnsmasq Make a dev directory Install Nginx, MySQL, phpMyAdmin, and dnsmasq Open your terminal app and run: $ /bin/bash -c "$(curl -fsSL )"Ģ. If you follow the tutorial and end up with issues, questions, or suggestions for improvement, please leave a comment and I’ll do my best to reply. A localhost LEMP stack tailored to a fresh installation of macOS Monterey in 2022. My previous setup used a vhost file to make each subdirectory in my ~/Sites folder into its own *.localhost domain and I wanted to keep that up. I just want my environment to be fast and work with as many native applications as possible, while also being extremely easy for me to spin up a new dev environment. There’s no SSL (and no plans to enable that at this time). It’s not perfect, but it works for the theme development work I typically do.

PHP MYSQL FOR MAC PRO

Just picked up a new M1 MacBook Pro and I decided it was finally time to document my process for getting a working local LEMP environment up and running.








Php mysql for mac