Do I need to install WordPress Locally?
Installing WordPress is not a painful process. There’s little reason why you should not install it locally, but there are many reasons why you should. We’ll explore the reasons here.
Installing a new theme, or widget or plugin is better to try out on your local WordPress. If anything happens and you mess up the installation, at least the world can’t see it (just yet).
Experimenting with the more advanced features of WordPress, especially the ones which require that you go to the PHP code level, it is a prudent decision to try it out on some sort of a staging platform (your local WordPress) , before promoting your refined code to your live WordPress.
Local WordPress installations operate at LAN speed, it is easier to make changes quickly and rapidly, as compared to your live (hosted) WordPress, which operates at internet speed.
Installing WordPress on Windows:
- Get a WAMP stack, WAMP is short for Windows, Apache, MySql and PHP. You can download it from here.
- When you finished downloading, double click the installation file, and follow the step by step install of WAMP. You will need WAMP because WordPress requires a working PHP and MySQL installation. There are other ways of getting PHP and MySQL installed on your PC, but the WAMP way is straightforward, it will take care of most configurations for you, including installing PHP modules for Apache and MySQL modules for PHP. If you choose to install Apache, PHP and MySQL separately, you will need to configure each one of them, you need to be familiar with their configuration files.
- After installation, launch the WAMP application, you will notice a docked icon on your system tray that looks like a car speedometer.
- Hover your mouse on top of the WAMP tray icon, if it reads “WAMP server offline”, left click the icon and choose “start all services”
- Now test your shiny new WAMP stack, open up a browser and type http://localhost , you will see the opening screen WAMP.
Things that can go wrong:
You saw the message “web page not available” – check if you have started all services of WAMP, click on its system tray icon and choose “start all services”
Webpage is still not available even if you are sure, you started all services – This is the tricky part, it may have something to do with other software already installed in your PC. There are 2 ways to approach this, one is to try find all the possible applications that are preventing WAMP from starting, these are applications that use port 80. Try to shutdown skype (this app is known to use port 80). Try to shutdown IIS (internet information server), then try http://localhost again.
The second way of troubleshooting a web page not found error is to change the port of your WAMP installation. By default, Apache is installed and configured to run on port 80, you will need to edit the httpd.conf of Apache.
Using your favorite programming editor (or notepad), open the file c:\<whereeveryouinstalledWAMP>\wamp\bin\apache\apache2.2.x\conf\httpd.conf. Using the find tool of your editor, search for the term Listen 80, edit this to read Listen 1234 (you can choose 1234 or any number from 1025 to 65535, depending on your liking). Click the WAMP system tray icon again, and choose start all services, now open up a browser and type http://localhost:1234
Installing WordPress on Ubuntu.
- Get a terminal, xterm or gnome-terminal, in gnome desktop, just press ALT-F2, then type gnome-terminal.
- type sudo apt-get install apache2 php5 libapache2-php php5-mysql mysql-server mysql
- that’s it.
Preparing MySQL for WordPress.
You will need to create a MySQL database for your WP installation, set a username for the database and set a password for that user.
In WAMP, you can use phpMyAdmin, open up browser then type http://localhost/phpmyadmin, on the textfield labeled “Create database”, type a name for your database i.e. wordpressdb — remember this database name because you will use this in the WordPress configuration later.
In Ubuntu or debian, get a terminal, and enter the following commands:
mysql -u root -p
enter your password, then from the mysql prompt
mysql>create database wordpress;
mysql> GRANT ALL PRIVILEGES ON wordpress.* to root@’%’ identified by ‘yourpasswordhere’;
mysql>flush all privileges;
Finally, installing WordPress.
Wordpress has the famous 5 minute installation guide as part of the WordPress codex (you should really read it), but I’ll cover it here very briefly.
Unzip the file to your Apache document root — for WAMP, unzip this in c:\<whereyouinstallWAMP>\wamp\www. For ubuntu users, the simplest is to unzip it in /var/www, there are a lot of possible options on where to install this on Ubuntu, but the other ways might require that we mess around with Directory and Location directive of Apache, hence I just chose the quickest location to install WP.
Inside the WordPress install directory, copy the file wp-config-sample.php to wp-config.php.
Edit the file wp–config.php, change ‘databasename’ to ‘wordpress’ (the name of the database you created in the section “Preparing your database”), change ‘username’ to ‘root’ (or whatever user name you use in your MySQL installation, change ‘password’ to your password in MySQL.
Open up a browser, then type ‘http://localhost/wordpress/
At this point WordPress will begin installation, afterwhich, you will be ready to use your locally installed WordPress.
That’s it, WordPress right in your PC.
Leave a comment