How to run a wordpress php in local?


by aubrey , in category: PHP General , 5 months ago

How to run a wordpress php in local?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by mallory_cormier , 5 months ago


To run a WordPress PHP in local, you need to follow these steps:

  1. Install a local server: You can use software like WAMP (for Windows), MAMP (for Mac), or XAMPP (for multiple platforms) to set up a local server on your computer.
  2. Download WordPress: Go to the official WordPress website ( and download the latest version of WordPress.
  3. Extract WordPress: Once the download is complete, extract the downloaded ZIP file to a specific folder on your computer.
  4. Start the local server: Open the local server software you installed in step 1 and start the server (e.g., start Apache and MySQL in WAMP).
  5. Create a database: Open phpMyAdmin or any other database management tool provided by your local server software. Create a new database with a suitable name for your WordPress site.
  6. Configure the database: Open the WordPress folder where you extracted the files and look for a file named "wp-config-sample.php". Rename this file to "wp-config.php". Open the "wp-config.php" file and locate the following lines: define('DB_NAME', 'database_name_here'); define('DB_USER', 'username_here'); define('DB_PASSWORD', 'password_here'); define('DB_HOST', 'localhost'); Replace 'database_name_here', 'username_here', 'password_here' with the details of the database you created in step 5. Leave 'localhost' as the 'DB_HOST' unless you have changed it during the local server configuration.
  7. Move WordPress files: Move the entire WordPress folder (extracted in step 3) to the "www" or "htdocs" folder of your local server installation.
  8. Access WordPress site: Open a web browser and type "localhost" or "" in the address bar. You should see the WordPress setup wizard. Follow the on-screen instructions to complete the installation.

After the installation is complete, you can access your local WordPress site by typing "localhost/your-folder-name" (replace "your-folder-name" with the actual folder name where you moved the WordPress files) in your web browser.