Skip to content
Article

The “Complete” How-to Set Up XAMPP on Windows

If you run PHP locally on a Windows machine, you’re probably using XAMPP.  By default, you put all your files in the xampp directory (htdocs) to make things work.  However, if want a different directory structure (i.e. under “My Documents”) you can set up domain or subdirectory aliases.

The following steps are the mostly-complete guide to setting up XAMPP: set alternate folders/domains/subdirectories, enable “missing” extensions, and let it play nicely with VisualStudio’s local IIS.

  1. Download zip version
  2. run setup_xampp.bat to fix directories
  3. to access your local dev like `http://ALIAS.localhost:81/whatever.php`, in apacheconfextrahttpd-vhosts.conf add your custom directories like: (note port 81 from step 7)
    [php htmlscript=”true”]

    <VirtualHost *:81>
    ServerAdmin YOUR@EMAIL.COM
    DocumentRoot "/Relative/Path/To/LocalFiles"
    ServerName ALIAS.localhost
    ServerAlias www.ALIAS.localhost
    ErrorLog "logs/ALIAS.localhost-error.log"
    CustomLog "logs/ALIAS.localhost-access.log" combined

    <Directory "/Relative/Path/To/LocalFiles">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>
    [/php]

     

  4. Update your hosts file (C:WindowsSystem32driversetchosts) accordingly: 127.0.0.1 ALIAS.localhost
    (added bonus: wildcards in hosts file (untested))
  5. OR, instead of #3 and #4, configure subdirectory aliases in xamppapacheconfextrahttpd-userdir.conf, which will let you access your local dev like `http://localhost/ALIAS/whatever.php`
    [php htmlscript=”true”]
    <IfModule alias_module>
    # ===== Description of the following
    Alias /ALIAS "/Relative/Path/To/LocalFiles"
    # Access control, etc
    <Directory "/Relative/Path/To/LocalFiles">
    AllowOverride All
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
    </Directory>
    </IfModule>
    [/php]
  6. Allow “missing” extensions by uncommenting dll line in xamppphpphp.ini
  7. If also have IIS (VisualStudio) on same computer, you’ll need to change the ports (you can use other numbers)
    1. in xamppapacheconfhttpd.conf — change `Listen *:80` to `Listen: *.81`, `ServerName localhost:80` to `ServerName localhost:81`
    2. in xamppapacheconfextrahttpd-ssl.conf — change `Listen 443` to `Listen 442`
    3. ignore the message in xampp-control that says it started on port 80 (that’s hardcoded)
capabilities covered
B2C Solutions B2B Solutions Government Higher Education What We Do IT Consulting Support

The Atlantic BT Manifesto

The Ultimate Guide To Planning A Complex Web Project

Insights

Atlantic BT's Insights

We’re sharing the latest concepts in tech, design, and software development. Learn more about our findings.

Questions & Answers

Are there differences in application architecture that are important for the cloud?
It is important to build applications and workloads specifically for the cloud. You will want to carefully consider what services the cloud provider of your choice has to offer and how your application leverages those services.
Learn More about Are there differences in application architecture that are important for the cloud?
Are there any drawbacks to cloud hosting?
Yes, there will always be some risks associated with any hosting option. You are relying on the resiliency and engineering of infrastructure that has scaled at an astounding rate.
Learn More about Are there any drawbacks to cloud hosting?
What’s the benefit of hosting in the cloud vs. traditional options?
Reasons not to host in the cloud are few and far between. If you don't host in the cloud, you will spend more in both CapEx and OpEx to manage your applications or websites in a traditional environment.
Learn More about What’s the benefit of hosting in the cloud vs. traditional options?
How can I improve the performance of my application?
There are several primary reasons that applications perform poorly, and in some cases it’s a combination of several. 1) Data latency: If your application is making calls to a data source (whether it’s an API or a direct call) and there is latency at the data provider, your application performance will suffer.
Learn More about How can I improve the performance of my application?
Should I move my application to the cloud?
The answer is ‘probably yes’. There aren’t many reasons for an application to be hosted elsewhere, aside from occasional compliance standards, or requirements to integrate with local services that would require large amounts of data to move from on-premise to cloud.
Learn More about Should I move my application to the cloud?
Where should my application be hosted?
There are many different options for hosting, but most applications would do well with one of the cloud providers -- Amazon Web Services, Google Cloud Platform, Microsoft Azure.
Learn More about Where should my application be hosted?