How to install WordPress in localhost

Posted by Joys of Programming on in PHP, Wordpress

WordPress is the most commonly used blogging platform. If you are a developer, you may wish to test a lot of things in your machine. It may be related to the development of themes and plugins. WordPress can be installed in your machine locally.

  • You must have mysql,php and apache installed in your machine.
  • Create a database in mysql for wordpress
  • Download wordpress.
  • Unzip and untar the file
    $ tar -xzf latest.tar.gz

  • Now find out the root directory of your Apache. The value will be present in httpd.conf
     DocumentRoot "/usr/local/apache2/htdocs" 

  • Now copy the wordpress directory to the Document Root directory
    $ sudo cp -r wordpress /usr/local/apache2/htdocs 

  • Now start apache
    $ sudo apachectl start 

  • Enter in your browser the following address “http://localhost/wordpress”
  • If everything is fine, you will see a guided menu to install wordpress in your machine.
  • Enter the database name, username and password for the database created. You can follow the steps for installing wordpress in a web server.

In some cases, you may  not be able to create a wp-config.php file, then follow the following procedure


$ sudo cp wordpress/wp-config-sample.php wordpress/wp-config.php

Edit wp-config.php file.


/** The name of the database for WordPress */
define('DB_NAME', 'putyourdbnamehere');

/** MySQL database username */
define('DB_USER', 'usernamehere');

/** MySQL database password */
define('DB_PASSWORD', 'yourpasswordhere');

/** MySQL hostname */
define('DB_HOST', 'localhost');

Enter the values for database(putyourdbnamehere), username(usernamehere) and password(yourpasswordhere).

Enter “http://localhost/wordpress/install.php” in your browser. Now you will be able to successfully install wordpress in your machine

Tags: , , , , , , , , , ,

Comments:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Copyright © 2009-2012 Joys of Programming All rights reserved.
Desk Mess Mirrored v1.8.1 theme from BuyNowShop.com.