Advertisement
Guest User

Untitled

a guest
Mar 9th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. You can find your vHost file at /usr/local/etc
  2. When setting up a new vhost, make sure that you change "Order allow, deny" to "Require all granted"
  3. Make sure to update the Document Root and Directory to the correct ones.
  4. Then make sure you add the ServerName to your /private/etc/hosts file. To find this file go to Finder > Go > Go To Folder and type in /private/etc/hosts file
  5.  
  6. When setting up a new database/schema in MySql, go to your localhost, Data Import/Restore and if you have an exported DB import that file.
  7. In your project that the Database is used for, create a .private-environment-settings.php file and give it ServerEnvironmentSettings with the info from the user you set up in MySql.
  8.  
  9. To create a new user for that databse, in MySql, go to Users and Privileges > Add Account
  10. Then create a username and password. Go to Schema Priviledges and click Add Entry, then Select "ALL". Then Apply. Make sure to up date the .private-environment-settings.php file with this info, the dbHost should be localhost.
  11.  
  12. IF you get some crazy error about the user not being able to be created, if you are just using this for local, you can grab another user you have already created, go to Schema Privledges and add a new entry to use that schema, then update the .private-environment-settings.php file with that user's info.
  13.  
  14. <code>
  15. <?php
  16.  
  17. class ServerEnvironmentSettings {
  18. const dbName = 'have_a_baby_prod';
  19. const dbUsername = 'integramdevdbuser';
  20. const dbPassword = 'egEFYDEWht1kEPh9';
  21. const dbHost = 'localhost';
  22. }
  23. ?>
  24. </code>
  25.  
  26. After setting up your database and user you may need to change the home and siteurl values in wp_options.
  27. Right click on wp_options and click Select Rows - limit 1000. Under option_name find site url and change the option_value to the local url. Then search for home under option_name
  28. SELECT * FROM my_schema_name_here.wp_options WHERE option_name = home;
  29. Then change that option_value to the local url. Click apply to save them.
  30.  
  31. From here you should be able to run your local site, make sure you have apache and mysql running. If you get an error with Apache, you may need to sudo stop and start it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement