How to set up a local server using xampp

Discussions about the phpBB3 Forum. How to get the best from this powerful script.
Note that there is no official support for phpBB3 here, a place to share more than to ask for.

Moderator: Moderators

How to set up a local server using xampp

Postby Typo » Mon Jul 20, 2009 11:53 am

After some recent posts and a discussion it was decided that we recommend using a test server way too much to not have a how-to or walk through for setting one up.

So, here it is...

  • Download and install XAMPP.
    You can install it pretty much where you want, since it's a portable application. It is usually handier not to install it in the wondows system hard drive / partition to be able to keep it upon windows re-install.


    NOTE :
    • Inside the folder you installed XAMPP to (default is 'c:\xampp\') there is a folder called 'htdocs'. This folder should be thought of as your new root folder and will be accessible via 'http://localhost/'.

    • Whenever accessing file from your harddrive through the web browser, in other words, when your trying to utilize your local server, do NOT use 'file:///C:/xampp/htdocs/', you MUST use localhost like 'http://localhost/' so unfortunately this means right clicking on a file and selecting 'Open With' and choosing IE or FireFox will not work as they will try and load it with 'file:///C:/xampp/htdocs/' and not 'http://localhost/'.

    • Last Tweak :
      Deleting htdocs/index.php may be handy. It's only used to redirect http://localhost/ to xampp's admin tools (such as phpMyAdmin) located in http://localhost/xampp/.
      If you do so, loading http://localhost/ will show you the list of directories available which is handy to browse them instead of having to type their exact location. And you can stil access xampp's admin tools by clicking on the xampp/ directory listed.

  • Download and install MySQLDumper.
    Installing MySQLDumper by simply copying it to the root folder of any/every site you wish to use it on and edit the config.php if needed (set for localhost by default). You can run MySQLDumper by loading "http://localhost/mysqldumper/" or "http://www.example.com/mysqldumper/" in your browser (or whatever location you put it in). The first time you run MySQLDumper on a site, it will ask which language you wish to install it in and will then install itself. After you have succesfully installed MySQLDumper you can create a new DB named identical to the one on the live site and then restore your backup into that database. The ideal backup method is to use MySQLDumper on the live site to make the backup but the program does have the capabilities to use backups from other software such as phpmyadmin.

    NOTE :
    • You need to protect the directory that you put MySQLDumper into any time that you put it online. After all, allowing normal users access to your database user name and password is a very very bad idea. To protect the folder, you can create your own .htaccess that will only allow access from your IP, or you can use the directory protection feature that is built into MySQLDumper which will allow you to password protect the directory.

    • Example .htaccess :
      Code: Select all
      Order Deny,Allow
      Deny from all
      Allow from 127.0.0.1

  • Install your online forum on the local server :
    • Backup all your forum / site files and copy them in a sub-directory of htdocs/, we will use phpBB3/ in this example.

    • If you did not already restore your backup from the live site as discussed above, this is the time to do it. Remember the steps are, create a database with the exact same name as one on the live site, backup a copy of the live site's DB using MySQLDumper or your preferred software, place the backup into the localhost's /mysqldumper/work/backup/ folder and then use your local copy of MySQLDumper to restore the DB.

    • Delete all the files in the phpbb's cache folder except for '.htaccess' .

    • Edit the phpbb config.php file and change dbuser (the database user name) to 'root', the dbpass (the database password) to '' (leave it blank), and the port to '3306' (the XAMPP default).

    • Edit the config table in the localhost copy of your db to make the cookie domain and the server url both point to 'localhost'. Also, if your putting the backup into a subfolder inside of htdocs, you will need to change the script path too. You can use MySQLDumper or PHPMyAdmin to edit them manually or run the following statements with the phpbb_ prefix altered if needed. Make sure you have selected your database before running the query(s).

      Code: Select all
      UPDATE `phpbb_config` SET `config_value` = 'localhost' WHERE `config_name` = 'server_name';
      UPDATE `phpbb_config` SET `config_value` = 'localhost' WHERE `config_name` = 'cookie_domain';

      And if needed: (The last line only needs to be run if your not putting the site directly into the root of yout localhost setup (into the htdocs folder and not a subfolder in it such as phbb3))
      Code: Select all
      UPDATE `phpbb_config` SET `config_value` = '/phpBB3' WHERE `config_name` = 'script_path';

    You should now be able to access the site locally. Try browsing to it by opening your browser and
    navigating to 'http://localhost/phpBB3/' (using the example above).

Now lets talk about some advanced configuration options. The settings we go over below are only the ones that may possibly be needed when working on large phpBB sites and large phpBB2 to phpBB3 conversions. Any setting changes suggested below require a xampp restart.

  • php.ini settings: In xampp, you will find 'php.ini' in '/xampp/php/'.

    • max_execution_time :
      Maximum execution time of each script, in seconds. The default value is 60 but you may need to use a higher value like this :
      Code: Select all
      max_execution_time = 300


    • max_input_time :
      max_input_time : Maximum amount of time (in seconds) that each script may spend parsing the request data. The default value is 60 but you may need to use a higher value like this :
      Code: Select all
      max_input_time = 300


    • memory_limit :
      Maximum amount of memory that a script may consume. The default value is 32M but you may need to use a higher value like this :
      Code: Select all
      memory_limit = 128M


    • mysql.connect_timeout :
      Maximum time (in seconds) for the connection to timeout. Just remember that it is useless to set it to a higher value than the PHP 'max_execution_time' value that we discussed a moment ago. An entry of '-1' means no limit. The default value is 60 but you may need to use a higher value like this :
      Code: Select all
      mysql.connect_timeout = 300


    • Other values that you could need to tweak are the one used to upload file, even though it's less likely to be mandatory, especially on a local server. Values to increase to be able to post bigger files are :

    • upload_max_filesize :
      The maximum size of any file that can be uploaded. In some rare cases you may need it to be even higher than the example. The default is 64m but you may need to increase it like in the following example :
      Code: Select all
      upload_max_filesize = 256M


    • post_max_size :
      The maximum size of any file that can be uploaded including any forms, fields, or mime headers length in bytes that may be sent with it. In some rare cases you may need it to be even higher than the example. The default is 64m but you may need to increase it like in the following example :
      Code: Select all
      post_max_size = 256M


  • my.ini settings: In xampp you will find my.ini' located in '/xampp/mysql/bin/'.

    • max_allowed_packet :
      The maximum size of one packet or any generated/intermediate string. The default is 1m but you may need to increase it like in the following example.
      Code: Select all
      max_allowed_packet = 2M


    • Remember to restart xampp after making any of the recommended changes.

Good luck!

I would like to say "Thanks" to dcz for helping me put together this guide.

Typo
User avatar
Typo
phpBB SEO Team
phpBB SEO Team
 
Posts: 346
Joined: Sun Jan 18, 2009 11:33 am

Advertisement

Re: How to set up a local server using xampp

Postby Professional » Tue Jul 21, 2009 12:52 pm

nice idea, thank u :D
انجمن تخصصی نسل جدید موبایل ها-Apple Portal
My Handwritings: Professional Dreams
Every Thing That U Feel,Is Every Thing That I Feel.
User avatar
Professional
PR5
PR5
 
Posts: 550
Joined: Mon Apr 07, 2008 5:41 am
Location: 1/2 of the World

Re: How to set up a local server using xampp

Postby dcz » Thu Jul 23, 2009 3:47 pm

And xampp rocks ;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21383
Joined: Fri Apr 28, 2006 9:03 pm

Re: How to set up a local server using xampp

Postby mitch » Tue Dec 08, 2009 8:44 pm

I do have a local server and a problem.
The server is WAMP and the php is 5.3.0
Mysql is 5.1.36
Apache 2.2.11

When ever I try to log into the local server it redirect to the online server
I deleted the .htaccess file and reloaded the server and it still does it rebooted the machine redownloaed the database and files still does it I'm lost
the other sites also phpbb doesn't do that.
Mind you this happened after a upgrade of gallery 1.04 and no I don't have the gallery mod
mitch
 
Posts: 30
Joined: Wed Dec 02, 2009 4:08 am

Re: How to set up a local server using xampp

Postby SeO » Wed Dec 09, 2009 11:58 am

Typo wrote:Edit the config table in the localhost copy of your db to make the cookie domain and the server url both point to 'localhost'. Also, if your putting the backup into a subfolder inside of htdocs, you will need to change the script path too. You can use MySQLDumper or PHPMyAdmin to edit them manually or run the following statements with the phpbb_ prefix altered if needed. Make sure you have selected your database before running the query(s).

Code: Select all
UPDATE `phpbb_config` SET `config_value` = 'localhost' WHERE `config_name` = 'server_name';
UPDATE `phpbb_config` SET `config_value` = 'localhost' WHERE `config_name` = 'cookie_domain';

And if needed: (The last line only needs to be run if your not putting the site directly into the root of yout localhost setup (into the htdocs folder and not a subfolder in it such as phbb3))
Code: Select all
UPDATE `phpbb_config` SET `config_value` = '/phpBB3' WHERE `config_name` = 'script_path';


You should now be able to access the site locally. Try browsing to it by opening your browser and
navigating to 'http://localhost/phpBB3/' (using the example above).


More details : phpBB Server and Cookie settings ;)
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: How to set up a local server using xampp

Postby mitch » Thu Dec 17, 2009 4:54 pm

Didn't work now I'm getting a 500 page
mitch
 
Posts: 30
Joined: Wed Dec 02, 2009 4:08 am

Re: How to set up a local server using xampp

Postby dcz » Sat Dec 19, 2009 9:43 am

I did not noticed you where not using xampp, but wamp. wamp may just need mod_rewrite to be activated to fix the 500, try deleting the .htaccess, and once you've activated mod_rewrite, to generate and implement a new one.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21383
Joined: Fri Apr 28, 2006 9:03 pm

Re: How to set up a local server using xampp

Postby pippo-c-l » Mon Dec 21, 2009 3:33 pm

Very very good typo.. but with seo mod i have error 404. I have read it but ever error 404

dcz wrote:Sur chaque sujet de mise à disposition des mod rewrite :
SeO wrote:Nous vous conseillons d'utiliser Xampp pour monter votre serveur local.

Pour activer le mod Rewrite avec Xampp en local :
Ouvrez le fichier <xampp-directory>/apache/conf/httpd.conf et remplacez :

Code: Select all
#LoadModule rewrite_module modules/mod_rewrite.so

par :
Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


ainsi que :
Code: Select all
<Directory />
    Options FollowSymLinks
    AllowOverride none
    Order deny,allow
    Deny from all
</Directory>


par :

Code: Select all
<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>



Xampp est beaucoup plus complèt que easyphp ;)
pippo-c-l
 
Posts: 45
Joined: Mon Dec 22, 2008 9:55 am
Location: Esauro

Re: How to set up a local server using xampp

Postby mitch » Mon Dec 21, 2009 3:56 pm

dcz wrote:I did not noticed you where not using xampp, but wamp. wamp may just need mod_rewrite to be activated to fix the 500, try deleting the .htaccess, and once you've activated mod_rewrite, to generate and implement a new one.

++

Yes That did fix the 500 problem but I still cant access it locally, it goes to my online site.
I even removed the .htaccess and still does it.
I just thought of something while typing this. I'm going to disable the mod from the database since I can't get there by browser.
be back....

Edited
I could not find it in the Database could you point me in the correct direction.
thanks
mitch
 
Posts: 30
Joined: Wed Dec 02, 2009 4:08 am

Re: How to set up a local server using xampp

Postby SeO » Mon Dec 21, 2009 6:53 pm

dcz wrote:wamp. wamp may just need mod_rewrite to be activated to fix the 500

The mod does requires mod_rewrite, you need to activate it.
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: How to set up a local server using xampp

Postby pippo-c-l » Mon Dec 21, 2009 8:29 pm

If i have:

Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so


And

Code: Select all
<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>


what is my problem? :oops:
pippo-c-l
 
Posts: 45
Joined: Mon Dec 22, 2008 9:55 am
Location: Esauro

Re: How to set up a local server using xampp

Postby SeO » Tue Dec 22, 2009 7:46 am

xampp restart most likely.
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: How to set up a local server using xampp

Postby pippo-c-l » Tue Dec 22, 2009 8:21 am

Don't work :roll:
pippo-c-l
 
Posts: 45
Joined: Mon Dec 22, 2008 9:55 am
Location: Esauro

Re: How to set up a local server using xampp

Postby mitch » Tue Dec 22, 2009 3:22 pm

I'm going to start a new post so there is no confusion
mitch
 
Posts: 30
Joined: Wed Dec 02, 2009 4:08 am

Re: How to set up a local server using xampp

Postby nostradamus » Sun Apr 04, 2010 9:41 pm

I have XAMPP installed and I have the MySQL Server running.

Are there some tests or procedures to check that everything is running properly eg IPconfig in the shell window.
I have XP Pro SP3

I found a multiple choice quiz which I would like to run using XAMPP and windows XP as a local server here at

-http://flesl.net/Technical/sample_quiz_code_e%20copy.php

any help or suggestions is always appreciated

I downloaded the page but the quiz does not run on my computer.

sorry if I sound like a simpleton but you don't know if you don't ask right !

kind regards

Richard
nostradamus
 
Posts: 1
Joined: Sun Apr 04, 2010 7:58 pm

Next

Return to phpBB Forum

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 61 guests