Last active
February 17, 2022 14:35
-
-
Save humayunahmed8/8f4a6baa95dac6c8ff2b50a1e14d0ad4 to your computer and use it in GitHub Desktop.
How to configure wp-cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prerequisite | |
================ | |
1. Download **xampp or wamp** | |
2. Download Powershell (https://github.com/PowerShell/PowerShell/releases/download/v7.2.1/PowerShell-7.2.1-win-x64.msi) | |
3. Create "wp.bat" file | |
4. Download "wp-cli.phar" (https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar) | |
# Official Doc: | |
================ | |
1. WP CLI phar - https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
2. WP CLI Commands - https://developer.wordpress.org/cli/commands/ | |
# How to configure: | |
==================== | |
1. Create a folder in => c:\wp-cli | |
2. Download "wp-cli.phar" file and put it c:\wp-cli | |
3. Create a filename like "wp.bat" in "c:\wp-cli" | |
4. Add this code in "wp.bat" file : | |
@ECHO OFF | |
php "c:/wp-cli/wp-cli.phar" %* | |
5. Go to "This PC > Properties > System Protection > Advance > Environment Variables > Path > Edit > New | |
6. After click New add this code below => | |
c:\wp-cli | |
F:\xampp\php | |
F:\xampp\mysql\bin | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Go to localhost/phpmyadmin | |
2. Select the current database | |
3. Go to wp_options table | |
4. Change the siteurl and home url : http://localhost:8080 (See screenshot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Doc Link : https://developer.wordpress.org/cli/commands | |
========================================================== | |
1. wp core download (download wordpress) | |
2. mysql -u root (switch to database) | |
3. create database db_name; (create a database) | |
4. wp config create --dbname=db_name --dbuser=root (Configure Databse with wordpress) | |
5. wp core install --url="F:\xampp\htdocs\project-name" --title="Project Title" --admin-user="admin" --admin_email="test@exmaple.com" --admin_password="admin" (Intall wordpress) | |
6. wp server (Listen to server) | |
7. Run wordpress => http://localhost:8080 | |
8. ctrl+c (close command) | |
9. clear (clear command line) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to add "Environment Variables"