

To start MySQL and PHP, run the following command: #if MySQL is not running, run this: Let’s start configuring mywebsite cd mywebsiteįind this and change accordingly: define( 'DB_NAME', 'database_name_here' ) ĭefine( 'DB_PASSWORD', 'password_here' ) Ĭhange it to this: define( 'DB_NAME', 'wpdb' ) Rename the folder to mywebsite mv wordpress mywebsite Now that we have PHP, MySQL and a database, we are now ready to install WordPress How to install WordPress on Macįirst we have to download WordPress to your website folder cdĮxtract the downloaded file tar -xf MySQL server user is root and no password.Ĭreate a database for WordPress website. On your terminal, execute this command to install MySQL brew install mysql To stop the php service, go back to the Terminal and press control + x How to install MySQL on Mac Open Safari and type this url: 127.0.0.1:8080/phpinfo.php While you are on the directory Documents/website, type this command on Terminal to run PHP service php -S 127.0.0.1:8080 But if your mac don’t have php, open the Terminal and paste this command: brew install phpĬopy and paste this code on the Terminal As of this date, PHP is included in macOS.


Once homebrew is installed, you can now install PHP. Please check my post about how to install homebrew. To install php and mysql, you need homebrew to install this packages on Mac. MySQL is where data is being stored and retrieve by PHP when WordPress runs SQL queries.PHP make WordPress possible to interact with the database and fetch data.You can install WordPress on Mac locally without XAMPP or Mamp.
