Advertisement
Guest User

Untitled

a guest
May 12th, 2016
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.38 KB | None | 0 0
  1. # How to install a new WordPress site from scratch using WP-CLI.
  2. # We are going to assume that you have installed WP-CLI with all of the needed dependencies (composer, mysql, php) and added them to the global system/user path.
  3.  
  4. # Commands that you need to use in the CLI are marked with a ">" at the start of the row (you don't need to add that to the command).
  5.  
  6.  
  7. # Create a new empty directory in your /www path. You can do that from the CLI directly. We are going to do a local install using WAMP software stack.
  8. # Either go to the /www directory through explorer and create a new folder or use the following command in the CLI (you have to change your current directory to '/wamp/www' first).
  9.  
  10. > mkdir wordpress
  11.  
  12. # Change the current directory to the newly created one.
  13.  
  14. > cd wordpress
  15.  
  16. # Use WP-CLI to download the WordPress core.
  17.  
  18. > wp core download
  19. Downloading WordPress 4.5.2 (en_US)...
  20. Success: WordPress downloaded.
  21.  
  22. # Next, you have to create the wp-config.php file.
  23.  
  24. > wp core config --prompt
  25.  
  26. # This will prompt you for the parameters needed to setup the file.
  27. # You have to fill in only the first two parameters for a local install (assuming the root password is blank - the default WAMP uses for MySQL).
  28. # You can skip the next 9 prompts for the local install.
  29.  
  30. 1/11 --dbname=<dbname>: wordpress
  31. 2/11 --dbuser=<dbuser>: root
  32. 3/11 [--dbpass=<dbpass>]:
  33. 4/11 [--dbhost=<dbhost>]:
  34. 5/11 [--dbprefix=<dbprefix>]:
  35. 6/11 [--dbcharset=<dbcharset>]:
  36. 7/11 [--dbcollate=<dbcollate>]:
  37. 8/11 [--locale=<locale>]:
  38. 9/11 [--extra-php] (Y/n):
  39. 10/11 [--skip-salts] (Y/n):
  40. 11/11 [--skip-check] (Y/n):
  41. Success: Generated wp-config.php file.
  42.  
  43. # Next, we need to create the database for the local WordPress install. This will create a database named wordpress. Based on the name you gave it at the previous step.
  44.  
  45. > wp db create
  46. Success: Database created.
  47.  
  48. # Now we'll install WordPress locally. You'll have to fill in the details for the installation.
  49.  
  50. > wp core install --prompt
  51.  
  52. # The CLI will prompt you for the next parameters needed to setup the WordPress site.
  53.  
  54. 1/6 --url=<url>: localhost/wordpress
  55. 2/6 --title=<site-title>: test
  56. 3/6 --admin_user=<username>: admin
  57. 4/6 --admin_password=<password>: admin
  58. 5/6 --admin_email=<email>: admin@example.com
  59. 6/6 [--skip-email] (Y/n): Y
  60. Success: WordPress installed successfully.
  61.  
  62. That's it! You now have a clean wordpress site named test and you can access it from the browser at 'localhost/wordpress'.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement