search
top

Install WordPress on Apache 2.4 on Windows

In following along with a previous post on installing Apache 2.4 PHP 5.4 and MySQL 5.5.21 on Windows, I will explain how to install WordPress 3.3.1. The installation is very easy to accomplish.

First download the latest version of WordPress from here, which at the time of this post it is 3.3.1. Next you will need to unzip the file to c:\apache24\htdocs\ on your system.

Next step is to create an empty database. To accomplish this task open a command prompt.Login to mysql and create the DB (wordpress) and create the user account and grant access.

$ mysql -u root -p
mysql> CREATE DATABASE `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
mysql> CREATE USER 'wpadmin'@'localhost' IDENTIFIED BY 'P$ssw0rd!';
mysql> CREATE USER 'wpadmin'@'%' IDENTIFIED BY 'P$ssw0rd!';
mysql> GRANT ALL ON `wordpress` . * TO 'wpadmin>'@'localhost';
mysql> GRANT ALL ON `wordpress` . * TO 'wpadmin'@'%';
mysql> exit

Close the command prompt open Windows Explorer and open C:\Apache24\htdocs\wordpress\wp-config-sample.php with a text editor of your choice.  Find the following lines and change the database name to wordpress and your username and password for , which by default is root with no password.

// ** MySQL settings – You can get this info from your web host ** //
/** The name of the database for WordPress */
define(‘DB_NAME’, ‘wordpress’);

/** MySQL database username */
define(‘DB_USER’, ‘wpadmin’);

/** MySQL database password */
define(‘DB_PASSWORD’,  'P$ssw0rd');

/** MySQL hostname */
define(‘DB_HOST’, ‘localhost’);

Save the file as wp-config.php.

Open your Internet browser and type in http://localhost/wordpress/wp-admin/install.php and everything from there should run smoothly to complete the installation.

5 Responses to “Install WordPress on Apache 2.4 on Windows”

  1. Fred says:

    Hello,
    It seems it is not so easy. I have installed apache 2.4 on my 2003 server (on which I was using apache 2.2.22) and I have a problem with wordpress : I can access to my homepage, but any article, page, or category return a 404 error. I was thinking about a mod_rewrite problem, but it is correctly activated into httpd.conf.
    Do you have any idea ?

    Thanks

    • newlife007 says:

      Fred, WordPress pages are contained in the MySQL database and rely on pho heavily. Take a look to make sure all the
      Modules are loading for pho and MySQL in apache and their configs.

  2. Keith says:

    Hi,
    I went through your entire article How install Apache 2.4 PHP 5.4 and MySQL 5.5.21 on Windows 7 today, and it seems to be all setup now. The localhost/info.php page loaded. I went through the PHPMyAdmin and setup a server named localhost with DNS of mysqli://localhost. I did all that bc I was tasked with researching WordPress (including installing it, and going through all its features to see if it is feasible for our company to use it). I started going through this article, which starts by saying to login to the MySQL 5.5 through the command prompt and creating a empty DB.

    The line $ mysql -u root -p (press enter) moves to the next line with
    ->. I then try to input the next line to create the DB ‘wordpress’ and get the following error.

    mysql> $ mysql -u root -p
    -> $ mysql -u root -p
    -> CREATE DATABASE ‘wordpress’ DEFAULT CAHRACTER SET utf8 COLLATE utf8_gener
    al_ci;
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
    corresponds to your MySQL server version for the right syntax to use near ‘$ mys
    ql -u root -p
    $ mysql -u root -p
    CREATE DATABASE ‘wordpress’ DEFAULT CAHRAC’ at line 1

    I can’t seem to find the answer in the documentation it directed me to. I am brand new to creating a DB in this fashion, as I have always used a GUI like oracle. So any help you can give would be wonderful. And as a followup question, do you know if you can use oracle DBs with wordpress instead of just MySQL?

    • newlife007 says:

      Keith,
      At the terminal you type to get into a mysql prompt.
      $ mysql -u root -p

      From there you can create the database.

      mysql> CREATE DATABASE `wordpress` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
      Query OK, 1 row affected (0.03 sec)

      mysql>

      Make sure you are using back ticks around wordpress, if you are not sure they are on the same key as tilde ~ resides. Try that and see if that works for you.
      On the Oracle question, WordPress only supports MySQL. http://wordpress.org/about/requirements/. If you have any other questions please don’t hesitate to ask.

  3. TAB says:

    Hello!
    0. Is ‘>’ spurious in
    GRANT ALL ON `wordpress` . * TO ‘wpadmin>’@’localhost’;?
    1. To save on typing, I put your MsSQL commands a script iniWP.sql:
    CREATE DATABASE `WordPress` DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
    CREATE USER ‘WPAdmin’@’localhost’ IDENTIFIED BY ‘xxx’;
    …, saved it in the bin folder of MySQL, and executed it in MySQL with the Source statement:
    mysql> source iniWP.sql

Leave a Reply

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

top