• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Setting up a local server environment...

#1
You may use XAMPP, WAMPP or another system, but one thing I noticed was that they run really slow.

I installed PHP, Apache & MySQL separately and they worked really fast. This tutorial will tell you how to do exactly that.

Downloads

You will have to download the following files:

Apache 2.2 Windows MSI
MySQL Installer
PHP Binaries

Step 0

Uninstall any current Apache, PHP, MySQL server's you have installed.

Step 1

Install all the programs. The default installation will do fine - extract PHP to C:\php.

Step 2 - Setup the webroot

Choose where you want your files to be located. In this tutorial, I will use C:\www. Open the httpd.conf file located in the C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf directory.

Find the 'DocumentRoot' definition (it was on line 185 for me), and change it to where you want your files to be - use quotations!
Code:
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "C:/www"
Once you've set the document root, you have to let people (you) see it (and allow htaccess files). To do this, add this code at the end of the httpd.conf file:
Code:
<Directory "C:/www">
  Options Indexes Includes FollowSymLinks MultiViews

    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
(make sure you change the path to your chosen path!)

Step 3 - Enable mod_rewrite

xenForo uses mod_rewrite, so lets enable it.

Again in the httpd.conf file, search for the following text:
Code:
LoadModule rewrite_module modules/mod_rewrite.so
and make sure there IS NOT a '#' symbol before it.

Step 4 - Setup PHP

There should be a file called php.ini-development in the C:\php folder. Open it up to edit.

Nothing really needs to be changed in this file, except a few lines. Add:
Code:
include_path = ".;c:\php\includes"
somewhere in the file.

Next, add the following lines to the end of the file:
Code:
extension_dir = "C:\php\ext"
extension=php_mysql.dll
extension=php_mysqli.dll
Now go back to your httpd.conf file, and add the following lines:
Code:
#PHP
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
Save all the files you've been working in.

Step 5 - The Final Steps

That's it, your almost done!

Now all you have to do is copy the C:\php\php.ini-development file to C:\Windows and rename it to php.ini. Once done, reboot your machine.

All the services should now have started. To test, go to http://127.0.0.1 in your browser - you should have a white page that says 'Index of /' at the top - if so, well done! You can now copy the xenForo files to C:\www and run the installer.

Use the MySQL username root & no password (you don't need to change them, it's only a local test server).

Note: The MySQL port may be set to 3307 by default. It was for me, however I still had a MySQL server instance running using the 3306 port. If 3306 doesn't work, use 3307.

Any questions, just ask ;)

Optional Step 6 - Give your local site a local domain :p

You may have noticed that in Kier 's videos, he uses the http://kier URL. You too can have your own URL!

Just open the C:\Windows\System32\drivers\etc\hosts file in an editor, and add the following line:
Code:
127.0.0.1 <domain you want (no protocol>
Save the file, flush your DNS cache & maybe reboot, and try accessing http://<domain you want>!