Installing XAMPP Step by step: download, install, run. Installing WordPress on local machine using XAMPP Xampp won't install on windows xp

To develop and test sites or web applications, they usually use a local Web server, and after development they are transferred to a production server. Therefore, today I propose to consider the possibility of installing a local web server on the Windows 7 operating system, and since we have a site for novice developers, we will use a ready-made assembly of a web server for example XAMPP.

And we'll start with the basics, i.e. we will find out what a web server assembly is, what it consists of, why it is needed, in particular, we will analyze the XAMPP assembly, install it and, of course, check its work.

What is Web Server Assembly?

Building the web server- this is a certain set of applications necessary for the functioning of sites, after the deployment of which, you can immediately proceed to their development, without being distracted and without delving into the settings of each component of the web server.

An assembly of a web server usually includes at least 3 components: this is the HTTP server itself, a site development tool, i.e. programming language libraries, interpreter, etc., and a database management system. For such assemblies, the free software therefore the most common components are the Apache web server, MySQL DBMS, PHP and Perl programming languages.

If we talk about why such an assembly is generally needed, since you yourself understand that all this is installed and configured separately, then it is needed mainly in order to make life easier for novice developers so that they can simply install one program and immediately start, say, learn to program (create websites). For example, as the operating system of our local web server we will use Windows 7, since it is the Windows OS from Microsoft that is widely used in Russia.

Of course, after the development of the site or web application is over, you need to transfer everything to a production server, which will most likely use a Linux-based operating system. For example, we have already considered the possibility of installing and configuring a full-fledged, working web server on CentOS 7.1, where we installed and configured each of the web server components separately, where we used Apache, PHP and MySQL. Also, if anyone is interested in installing the MySQL DBMS on Windows, then we examined this in detail here.

Note! It is not recommended to use a web server assembly on production hosting for sites, especially since the developers themselves warn that these assemblies are not intended for implementation into production.

The most popular web server assemblies include: Denwer, Open Server, XAMPP, WampServer... As the title of the article suggests, we will be looking at XAMPP today.

What is XAMPP?

XAMPP Is a free, cross-platform web server build that includes Apache, MySQL PHP, and Perl.

As you might guess, XAMPP is an abbreviation:

  • X - means there is an assembly for all operating systems (Windows, Linux, OS X);
  • A - Apache;
  • M - MySQL;
  • P - PHP;
  • P - Perl.

Last, for today ( June 2015), the XAMPP build for Windows includes the following software: Apache 2.4.12, MySQL 5.6.24, PHP 5.6.8, phpMyAdmin 4.3.11, OpenSSL 1.0.1, XAMPP Control Panel 3.2.1, Webalizer 2.23-04, Mercury Mail Transport System 4.63, FileZilla FTP Server 0.9.41, Tomcat 7.0.56 (with mod_proxy_ajp as connector), Strawberry Perl 7.0.56 Portable.

Where to download XAMPP?

You can download this assembly from the download page of the official website - https://www.apachefriends.org/ru/download.html

And since we will be installing XAMPP on Windows, we will accordingly download the distribution kit for this operating system, for example, I want to download the XAMPP version with PHP 5.6.8 for this, and I press the corresponding link.


After that, the distribution kit of 107 megabytes will be loaded.

This assembly supports operating Windows systems starting with Vista.

Installing XAMPP

Let's start with the installation of the XAMPP Web Server assembly, it is simple so you shouldn't have any problems.

Step 1

Run the downloaded file xampp-win32-5.6.8-0-VC11-installer.exe... The first window of the installer is the welcome window, click " Next».


Step 2

Next, select the components that you want to install, by default everything is selected, but if you do not want to install something, i.e. You do not need this, then you can uncheck the corresponding item, for example, I do not need Perl, click "Next".


Step 3

Then we select the directory in which we will install XAMPP, I will leave it by default, press “ Next».


Step 4

At this step, we can leave or uncheck the “ Learn more about Bitnami for XAMPP", I unchecked the box, press" Next».


Step 5

Everything is ready for installation, click " Next».


The installation has started.


After the installation is complete, we will be prompted to immediately run " Control Panel", Click" Finish».


That's it, we have the XAMPP control panel launched.


Launching and testing Apache, PHP and MySQL

As we can see, immediately after installation, all services are not started, so we start them with the " Start».


Those services that are in green are highlighted in this moment launched.

First, let's check that Apache is working, for this we just type localhost in the browser, and if we see the following picture, then everything is in order.


To test MySQL and PHP, let's write a simple PHP script that will test the connection to the database. MySQL data... To do this, create a test folder in the C: \ xampp \ htdocs \ directory, by the way, everything in the htdocs folder can be deleted. In the test folder, create an index.php file with the following code;

Database server unavailable

"; exit ();) // Checking the availability of the database if ( [email protected] _select_db ($ dbname, $ dbconn)) (echo "

Database unavailable

"; exit ();) // Simple query, find out the MySQL version $ VERSION = mysql_query (" SELECT VERSION () "); if (! $ VERSION) (echo"

Error in request

"; exit ();) echo mysql_result ($ VERSION, 0);?>

We save and in the browser we refer to the address http: // localhost / test / in response we should get the MySQL version.


If you are surprised, then Apache and PHP and MySQL are up and running.

Now I'll tell you a little about the XAMPP control panel. You can run it through the menu "Start-> All Programs-> XAMPP".


After launch, an icon for quick control will appear in the system tray, i.e. starting and stopping services.

On this I propose to finish, since everything is ready for the development of sites based on Apache, MySQL and PHP, once again I note that this assembly is suitable exclusively for developing and testing web applications; it is not recommended to use it as a working platform for websites. Good luck!

During website development, it is often more convenient for me to write relative paths from the root folder so as not to change them when uploading to the server, and also so that when working with PHP, you can test the page on your computer right on local server.

XAMPP is completely free and contains the Apache distribution and makes it possible to work with PHP, Perl, MySQL.

Also, when using XAMPP, you can quickly install LMS Moodle or Wordpress using Bitnami.

Installing XAMPP

So let's start with how to install a local server on a computer using the XAMPP kit.

First you need to download the installer for your operating system. This can be done via the link on the official website: www.apachefriends.org/ru/index.html

In this article, I will download the installer for Windows, on the example of which, I will consider installing and configuring XAMPP.

After clicking the download button, the download of the.exe file will start (the file size is about 110MB).

When the download is complete, open the installation file (xampp-win32-5.6.30-0-VC11-installer.exe), run as administrator. In the welcome window, click next.


Next, we select the required components. We are interested in Apache. Additionally, you can choose PHP and MySQL.
Next, you need to select the installation path.
Next, the installer asks us to confirm that we are ready to start the installation. Click next.
The XAMPP installation has started.
After finishing the installation, you will be prompted to launch the XAMPP control panel. We leave a check mark. Click Finish.

The control panel will open. So far, you don't need to run anything. Now you can start creating domains on our Localhost.

Setting up subdomains and virtual hosts

Editing hosts

On the local server, we can configure the redirection of any browser requests to a specific folder of our server.

First you need to add site redirection in the hosts file. This file is located in the etc folder at: C: \ Windows \ System32 \ drivers \ etc

It does not have permission, so you will need to select a regular notepad on startup to open it.


If we want the site to open from a folder on our computer in D /: XAMPP / htdocs / barbershop when typing in the browser barbershop.local, add next line to our file.

Host creation

After editing the hosts file, let's move on to configure the servers.

We also open the httpd-vhosts.conf file in notepad, which is located in the D: \ XAMPP \ apache \ conf \ extra folder

At the very end we add the following text:

DocumentRoot "D: / XAMPP / htdocs" ServerName locahost ServerAlias ​​locahost ErrorLog "logs / localhost.log" CustomLog "logs / localhost.log" common
DocumentRoot "D: / XAMPP / htdocs / barbershop" ServerName barbershop.local ServerAlias ​​barbershop.local ErrorLog "logs / localhost.log" CustomLog "logs / localhost.log" common

Now go to the control panel and press start for Apache. The server started its work.

Outcome

Ready! Now, if we save the index.html or index.php file to the D: / XAMPP / htdocs / barbershop folder, and in the browser go to the barbershop.local address, then we will open home page our virtual host. If we want now, for example, from the file /barbershop/css/main.css to go to the folder / barbershop / img /, then now this link can be specified relative to the site root "/ img /".

What is a local server and why do we need it?

A local server is a set of programs that allow you to develop a website on a local computer without an Internet connection. It is similar to the servers that hosters have. If you are creating a website using only html pages with CSS design, then you do not need any local server. But if the site is dynamic, i.e. created using Php, Perl, MySQL, scripts, etc., you will need a local server to debug and test it.

Part 1. Installing XAMPP

I already wrote about what we will use as a local XAMPP server. Follow this link and select XAMPP for our platform. My operating system is Windows (you probably have it too), so click on XAMPP for Windows and we get to the page where we find the following block:

Choosing to download Installer... After the file is downloaded, launch it. In general, the entire further installation process does not require any intervention from the user, except for clicking the "Next" button, but still I will describe it in more detail. After we launched the installer, the following window appears on our screen:

There is no Russian language in the installer, so we leave English, click "OK".

Click "Next".

Here we are asked to choose where we will install XAMPP, we leave it unchanged. Click "Next".

Here we are asked to select the components to be installed. We leave it as it is, click "Install".

In a couple of minutes, the installation is complete. Click "Finish". We load this window, which is called the control panel, and the XAMPP icon appears on the desktop.

If the panel has not loaded, then click on the icon to load it. Here we will start and stop the Apache and MySQL servers. To start the server, click on the "Start" button. Click and this is what you should get:

We will only be running Apache and MySQL. As you can see from the screenshot, Apache uses Port 80... Skype uses the same port by default, and if you have Skype loaded and port 80 is busy, then Apache will not boot. Therefore, go to Skype: Tools-> Settings-> Advanced-> Connection and uncheck the "Use ports 80 and 443 as incoming alternatives"... Well, in conclusion, I want to add that to stop the server, we will press the "Stop" button. But for now, let's leave everything loaded. By the way, loading, stopping and restarting XAMPP can be done using special applications that are located in the C: \ xampp \ folder. xampp_start.exe, xampp_stop.exe and xampp_restart.exe.

Setting up XAMPP

The installation shouldn't have caused any difficulties. Let's move on to setting up. We start the Apache and MySQL servers and notice the button in the Apache line "Admin", click on it. This window is loaded:

Unfortunately, the Russian language is not represented, we choose the English version, as the most universal option. But you can choose another language you like. We get here:

This is the XAMPP web interface. Two points are important for us here. The first one is Security:

here are the security settings. If you follow the link http: //localhost/security/xamppsecurity.php you can set a password for the MySQL database administrator and there you can set a password for the XAMPP directory to restrict access from the local network:

I will not set passwords here yet, you act at your discretion.

Create a MySQL database

The second important point for us is phpMyAdmin... We go in and get to the next page:

That's why we fought our entire vegetable garden. phpMyAdmin is a web application for administering MySQL, and MySQL is a database management system, and our future site is the very database that MySQL will manage. It seems that I have clearly stated everything here, but I can not go into the details for now. We came here only for one reason - we do not yet have a database, so let's create it. Each database should have its own unique name, I have already come up with a name for our database, I propose to name it site... We select the "Databases" tab, at the bottom in the "New database" window we write site, in the "Comparison" window we select utf8_general_ci - this is the encoding for our database. Click "Create".

Create a MySQL database user

Now we need to assign a user to the newly created base. We go to "Privileges"

Click on "Add new user" and fill in the following fields:

Username- any word consisting of English letters

Host- Localhost

Password- any combination of English letters and numbers

For ease of remembering, many novice webmasters make both the password and the username the same as the name of the database, in our case it would be site. This turns out to be a huge security hole. Therefore, when you create your own site, do not be lazy to come up with another username, and generate a password using the "Generate" button, print and save in a safe and secure place. Here is an example of such filling:

But since we have a training course with you, I will act like a real novice webmaster, which, by the way, I am, and I will have a username and password. site.

Assigning privileges to the MySQL database user

Now you need to assign privileges to the created user, in Global privileges press "Check all" and say "Ok".

Part 2. Configuring virtual hosts

Editing the httpd-vhosts.conf file

How, not all yet? - you ask, alas, no, we come to the most interesting. In order for us to view our website in a browser, we need to set up a virtual host. To do this, we will go to edit the file C: \ xampp \ apache \ conf \ extra \ httpd-vhosts.conf. We open the file with Notepad ++ or regular notepad. Now there is some information in this file, all lines of which start with #. We do not touch it, but below we add the following code:

NameVirtualHost 127.0.0.1


ServerName localhost
ServerAdmin [email protected]

Here we specify the name of the virtual host and describe the local host. Now we need to add data to make our site work. Our site will be named the same as we named the database - site, but the names of the site and the database do not have to be the same. Of course, our site will have to be called something like www.site.ru, but we do not need to indicate the full name of the site, since this name will be used only on our local computer, and we do not need to write extra letters, so we will call it just site. Below the code we just added, add more code:


ServerName site
ServerAlias ​​www.site
ServerAdmin [email protected]
DocumentRoot "C: / xampp / htdocs / site / www /"
ErrorLog "C: /xampp/htdocs/site/logs/error.log"
CustomLog "C: /xampp/htdocs/site/access.log" combined

AllowOverride All
Order allow, deny
Allow from all

ServerName site - The name of our site, which you can write without.
ServerAlias ​​www.site - Alternative title site
ServerAdmin [email protected] - Resource administrator mail
DocumentRoot "C: / xampp / htdocs / site / www /" - Site files folder
ErrorLog "C: /xampp/htdocs/site/logs/error.log" - Error log
CustomLog "C: /xampp/htdocs/site/access.log" combined - Visit log

When you want to create another site, you just need to copy and add the last code, replacing the site name with a new one.

Editing the hosts file

It remains to add our site to the database of domain names of our Windows operating system. To do this, in Windows 7, go to the C: / Windows / folder and find the file in it notepad.exe, select it and click right button mouse, select "Run as administrator", then File >> Open, select the folder C: / Windows / Sistem32 / drivers / etc / and in the "File name" field we drive the word hosts... If done correctly, it will open hosts file... It will contain some information, also commented out with hash #. Below we add the following construction:

127.0.0.1 site

If you will create another site, say site2, do not forget to add to this file:

127.0.0.1 site2

Making a sendmail mail stub for XAMPP

To be able to view emails while testing the form feedback, it is necessary to make a so-called mail stub. This is done as follows, open Notepad ++, create new document, select PHP syntax and UTF-8 encoding, then put the following code in this document:

// folder where we will put mail
define ("DIR", "c: / xampp / tmp / sendmail /");

// get the message body from the stream
$ stream = "";
$ fp = fopen ("php: // stdin", "r");
while ($ t = fread ($ fp, 2048))
{
if ($ t === chr (0))
break;
$ stream. = $ t;
}
fclose ($ fp);

// Save to file
$ fp = fopen (mkname (), "w");
fwrite ($ fp, iconv ("UTF-8", "CP1251", $ stream));
fclose ($ fp);

// Function for assigning a name to the file
function mkname ($ i = 0)
{
$ fn = DIR.date ("Y-m-d_H-i-s _"). $ i. ". eml";
if (file_exists ($ fn))
return mkname (++ $ i);
else return $ fn;
}

Save the file under the name sendmail.php to the C: \ xampp \ sendmail \ folder. Then, in the C: \ xampp \ tmp \ folder, create a folder sendmail.

In the php.ini file (C: \ xampp \ php), replace the line:

Sendmail_path = "C: \ xampp \ sendmail \ sendmail.exe -t"

per line:

Sendmail_path = C: \ xampp \ php \ php.exe c: \ xampp \ sendmail \ sendmail.php

Restart XAMPP. If you did everything correctly, all sent emails can be viewed in the C: \ xampp \ tmp \ sendmail \ folder. But so far we have no feedback, therefore, we will check when we create it.

Creating a folder for our site

We have already done so much, came up with a name, even registered the paths to our site, and still haven't even created a folder for it. Now is the time to do it.

All sites that we will create, we will place in the C: / xampp / htdocs / folder. In theory, it is not necessary to use this particular folder, you can use any other one, but for this you will need to change the paths in the httpd-vhosts.conf file. But we will not deviate from tradition. Let's create our folder site in folder htdocs... And now, in the C: / xampp / htdocs / site / folder, create two more folders: www and logs... The www folder will contain all the files of our site, which we will then transfer to the hosting. The logs folder will contain two files - the error log and the visit log.

Well, that's all. This concludes our first lesson. I have timed the time it took me to do everything described in this tutorial. I got about 10 minutes. Let's add time to download the XAMPP distribution, well, let it be 5 minutes. In total, it turns out that we completed our first lesson in 15 minutes. I do not take into account the time for acquaintance with the material, since our slogan is "Site in one day!" does not mean learning this process in one day, but the time in which we will create a website. See you in the next lesson.

Now we will organize local hosting to install and study this content management system. Of course, you can install Joomla directly on an Internet hosting, especially since the current prices are affordable for everyone - you just need to choose a hosting provider. But ... work on a website is not always limited to one day. What if your Internet connection is in a fever at this time? And what if you made mistakes and the site is "lying" in an unsightly form? It is better to calmly set everything up at home, debug everything, sort it out, and only then transfer the site to the "combat" server.

Installing XAMPP on Windows 7

The complete XAMPP package for Windows contains: Apache 2.4.10 web server with SSL support, MySQL 5.6.21 DBMS, PHP 5.5.19, Perl, FileZilla FTP server 0.9.41, Mercury Mail Transport System 4.63 (mail server), 4.2 .eleven. As you can see, such a set corresponds to system requirements Joomla. There are even useful additions in the form of a mail server (useful for sending mail from a local site) and phpMyAdmin (for working with a MySQL database).

Download the distribution kit (143 MB) from the project website. Before starting the installation, disable UAC ( User Account Control). This is done as follows. Go to the control panel and enter UAC in the search field located in the upper right corner.

We lower the slider to the lowest position and save the changes. That's it, UAC is disabled.

Now we run the XAMPP executable file with administrator rights. In the welcome window, click "Next". In the component selection window, mark everything.

Again "Next". Uncheck the box - you can install Joomla! And you can learn about the Bitnami project later.

We proceed to the next step, where it is reported that the program is ready for installation. Well, once the program is ready, let's start the installation. In a few minutes we receive a message about successful completion.

Uncheck the box - we will not start the XAMPP control panel now. We reboot the computer.
After restarting your computer, launch the XAMPP Control Panel (Start-> All Programs-> XAMPP-> XAMPP Control Panel). Let's take a quick look at the controls.

Click on the "Config" button in the upper right corner of the panel and call up the general settings of the control panel. The Editor field, by default, uses the Windows text editor, well known as Notepad. This is where the configuration files for XAMPP modules will open. But I would recommend installing Notepad ++ text editor on the system. It is needed not only for editing XAMPP configuration files, in the future, it will be very useful to you when working with the site. Replacing one editor with another in the XAMPP control panel is done with a button with a folder image and an indication of the path to the executable file.

In the XAMPP control panel settings window, you can enable the options to automatically start the necessary modules. Apache and MySQL are marked in the figure. Now, when starting the control panel, the marked modules will start automatically.

Below, there is one more useful option- "Start Control Panel Minimized". If it is checked, then upon startup, the XAMPP control panel will immediately be minimized to the tray (lower right corner of the Windows taskbar).

If you go to the "Service and Port Settings" button, then a window with the settings of the port numbers used by this or that XAMPP module will open. Now nothing needs to be changed in it. This should be done, for example, in the case when any program installed on the computer uses the same port as one of the XAMPP modules, which creates a conflict.

We exit the general settings window and look at the control panel itself. On its left side there are buttons with a red cross. They allow XAMPP modules to run as services. That is, the marked modules will be launched together with operating system and work in background... On the one hand, it is convenient. But these services will work even when you are not using your local hosting, and they will consume computer resources. So decide for yourself.

If the modules do not start automatically, then they can be started using the corresponding buttons "Start". To install Joomla, you need Apache and MySQL to work.

Now let's check the work of local hosting. In the address bar of the browser, type localhost and go to this address. For the first time, you will see a window with a choice of language. There is no Russian language in the list, so we choose English. If after that you see the following page, then local hosting is working and you did everything right.

But that is not all. Some changes need to be made. First, you need to set a MySQL password for the "root" user (superuser, administrator). The password is now empty. This is not very good! We click on the link "Security".

In the tab (window) that opens, follow the link http: //localhost/security/xamppsecurity.php. Now in the section "MYSQL SECTION:" ROOT "PASSWORD" enter and confirm the password for the "root" user. Leave the "PhpMyAdmin authentification" switch in the "cookie" position. Click the "Password Changing" button. Now it's good! We remember the password, you will need it when installing Joomla. Also, the credentials (login and password) of the "root" user will be required when logging into phpMyAdmin - the web interface of the MySQL DBMS. You can log into phpMyAdmin using the link located on the page http: // localhost (almost at the very bottom) or by typing http: // localhost / phpmyadmin in the address bar of your browser.

And the next article will describe the installation of Joomla!

More Joomla 3 Articles

    • In the previous article on Joomla settings, we looked at a group of settings common for the entire site. One of the settings sets the CAPTCHA type on the site. But without some manipulation, this will not work. This article describes how to enable and configure a CAPTCHA on a site running ...

First, let's take a look at what the XAMPP web server is and compare the versions for Windows.

XAMPP - cross-platform web server build containing Apache, MySQL, interpreter PHP scripts, the Perl programming language and a large number of additional libraries that allow you to run a full-fledged web server.

At the time of this writing, two versions of XAMPP for Windows are available for download on the site: XAMPP Windows 1.7.2 and XAMPP Lite 1.7.2.

Web server version XAMPP Windows 1.7.2 XAMPP Lite 1.7.2
Libraries Apache 2.2.12 (IPV6 enabled) Apache 2.2.12 (IPV6 enabled)
MySQL 5.1.37 (Community Server) with PBXT engine 1.0.08-rc
PHP 5.3.0 + PEAR (PEAR, Mail_Mime, MDB2, Zend) PHP 5.3.0 + PEAR
Perl 5.10.0 (Bundle :: Apache2, Bundle :: Apache :: ASP, Bundle :: Email, Bundle :: DBD :: mysql, DBD :: SQlite) Mini Perl 5.10.0
XAMPP Control Version 2.5.8 (ApacheFriends Edition)
XAMPP CLI Bundle 1.6 XAMPP CLI Bundle 1.6
XAMPP Port Check 1.4 XAMPP Port Check 1.4
XAMPP Security 1.1 XAMPP Security 1.1
SQLite 2.8.17 SQLite 2.8.17
SQLite 3.6.16 SQLite 3.6.16
OpenSSL 0.9.8k OpenSSL 0.9.8k
phpMyAdmin 3.2.0.1 phpMyAdmin 3.2.0.1
ADOdb v5.09a -
FPDF v1.6 -
Zend Framework 1.9 Minimal Package (via PEAR) -
Mercury Mail Transport System v4.62 -
msmtp 1.4.17 (a sendmail compatible SMTP client)
FileZilla FTP Server 0.9.32 -
Webalizer 2.21-02 (with GeoIP lite)
Xdebug 2.0.5 for PHP -
eAccelerator 0.9.6-rc1 for PHP -
Ming 0.4.2 for PHP Ming 0.4.2 for PHP
PDF with pdflib lite v7.0.4p4 for PHP
System requirements 128 MB RAM 128 MB RAM
256 MB free fixed disk 160 MB free fixed disk
Windows 2000, XP (Server 2003), Vista (Server 2008)
all systems 32 bit (64 bit not tested)
The size EXE 44MB ZIP 84MB EXE 26MB ZIP 56MB
Download page http://www.apachefriends.org/en/xampp-windows.html#641 http://www.apachefriends.org/en/xampp-windows.html#646

The issue of choosing a version is only in the availability of the necessary libraries (see the table above), the light version, according to the authors' statement, is not updated as often as the full package, the installation process for both versions is absolutely identical. Go to the site using the links above and download the version that suits you (in the review I will talk about installing and XAMPP setup Windows 1.7.2, installation was performed on Windows 7 Ultimate x86).

Installing XAMPP Web Server

1. Beginning the installation of XAMPP. A window will open in which we are asked to choose the path to host the server. By default, this is the C: \ drive. I will not change the path and will install the server on the suggested drive. We press the Install button and wait until the distribution kit is completely unpacked.


2. After unpacking the distribution, the command line will start, then the main installation will be done through it. XAMPP offers to create shortcuts on the desktop and in the start menu, press enter.


3. Now we are asked if the correct XAMPP installation directory is selected, by default the server will be located at the following address C: \ xampp, press enter.


4. Do we want to install the portable version? Press enter, because XAMPP is installed on your hard drive.


5. Final installation of XAMPP. Press enter to continue.


6. Automatic selection of the time zone. Press enter.


7. Launch the XAMPP Control Panel, select 1 and press enter.


8. The server control panel has opened. Close command line.

Control panel tips:

Checkboxes (Svc)- sets the module as windows services(if you want to run any module (Apache, MySQL, etc.) as a service, then check the appropriate boxes)

Admin- starts administration of the module (Admin opposite the Apache module - will open the XAMPP welcome window, select the language. And we get to the XAMPP web interface, here you can check the demos in the Demos section, find out information about the modules, etc. Admin opposite the MySQL module - will start phpMyAdmin)

Shell- launching the command line to work with the server;

Setup- opens a command line for configuring XAMPP;

Port-Check- ports check;

Explore- opens the folder where XAMPP is installed, in our case C: \ xampp;

SCM- opens a window for managing Windows services;

Refresh- updating the status of modules;

XAMPP is launched using a shortcut on the desktop or in the start menu, if you refused to create shortcuts during installation, you can start XAMPP using the xampp-control.exe file in the C: \ xampp directory, where you can see all the other shortcuts that can run individual modules, uninstall XAMPP, etc.

The XAMPP icon sits comfortably in the tray and opens the XAMPP Control Panel when left-clicking.

9. Launch the Apache and MySQL modules (Start buttons), type localhost in the browser (or press Admin opposite the Apache module):

10. POn the first launch, the welcome page will open, select one of the proposed languages:


11. We get into the XAMPP web interface, here you can see the documentation, examples in the Demos section, etc.:


The Security section contains security settings:



So we have installed and familiarized ourselves with the XAMPP web server, now it is time to create a test page and host our project.

In order to create a new site on the local web server, you need to create a folder with the name of the site in the C: \ xampp \ htdocs \ folder, for example blog and create a test php script there with the code:

Let's save it as index.php. Folder structure:

We go to the browser at http: // localhost / blog / and, if everything is done correctly, we see the greeting "Hello world!", Thereby we tested the server's performance:


The web server can be installed in another way, for this you need to unpack the installer or ZIP archive to any location convenient for you on your hard disk, the name of the xampp folder can be renamed, for example, to server and the installation can be started using the setup_xampp.bat file in this folder, repeat all the steps described above.

If you are installing XAMPP for the first time, then I recommend that you do not change the folder names for the first time, and install the default web server, so that later you do not look for errors that may occur when specifying incorrect paths for virtual hosts, which will be discussed below.

Configuring virtual hosts

If we want to store our projects in another folder (for example, My Documents) or the local version of the site should work when going to www.blog.ru, you need to figure out how to configure virtual hosts, this will be discussed in this subsection.

Suppose our site should be stored on the C drive in the my_projects folder (C: \ my_projects), in the browser it should open at www.blog.local or blog.local.

Let's create a folder called blog.local in the my_projects folder, create the www and logs folders in it. Put our test script index.php into the www folder.

This is how it will look in file system Windows:

Now let's move on to configuring virtual hosts. We open in text editor the httpd-vhosts.conf file located at the following location: C: \ xampp \ apache \ conf \ extra.

We will not touch everything in the httpd-vhosts.conf file, but simply add our hosts (just copy and paste the code below):

NameVirtualHost *: 80 ServerAdmin

The top virtual host, highlighted in a different color, will allow us to still go to localhost (the local XAMPP site).

The next step we need to add two lines to the hosts file, located at the following address C: \ Windows \ System32 \ drivers \ etc \ hosts (I also recommend creating a shortcut for it in the server folder):

127.0.0.1 blog.local 127.0.0.1 www.blog.local

Go to the XAMPP Control Panel and restart Apache. Now let's check our site, which should work at www.blog.local. If everything is done correctly, then we will see the greeting "Hello world!".

Since most likely you will need to create several sites on a local server, I will give an example of adding hosts to the httpd-vhosts.conf file. Let's say the new site is called site.local:

NameVirtualHost *: 80 DocumentRoot "C: \ xampp \ htdocs" ServerName localhost ServerAdmin DocumentRoot "C: \ my_projects \ blog.local \ www" ServerName blog.local ServerAlias ​​www.blog.local ErrorLog "C: \ my_projects \ blog.local \ logs \ error.log" CustomLog "C: \ my_projects \ blog. local \ logs \ access.log "combined AllowOverride All Order allow, deny Allow from all ServerAdmin DocumentRoot "C: \ my_projects \ site.local \ www" ServerName site.local ServerAlias ​​www.site.local ErrorLog "C: \ my_projects \ site.local \ logs \ error.log" CustomLog "C: \ my_projects \ site. local \ logs \ access.log "combined AllowOverride All Order allow, deny Allow from all

Also, do not forget to add the following lines to the hosts file in the Windows folder:

127.0.0.1 site.local 127.0.0.1 www.site.local

Restart Apache and the new host is ready to go.

By analogy, you can add as many virtual hosts as you like.

A bit of background information on what we add to the httpd-vhosts.conf file:

Installing WordPress on XAMPP

To install WordPress, we will use the previously created virtual host blog.local, therefore the engine files will be located in the blog.local folder (C: \ my_projects \ blog.local \ www).

1. Download the latest version of WordPress from the official website www.wordpress.org and unpack the archive into the www folder (the contents of the wordpress folder in the archive).

2. Let's go to phpMyAdmin and create a database for our blog:


New database: blog; comparison: utf8_general_ci; mapping the connection to MySQL: utf8_general_ci → click the Create button.

So, the database is created:


3. Go back to the folder where we unpacked WordPress and find the wp-config-sample.php file, rename it to wp-config.php and open it in any text editor that supports UTF-8 encoding and enter your data:

- Database name for WordPress: blog;

- MySQL username: root;

- MySQL user password: leave blank if in Security settings did not indicate anything;

- MySQL server address: localhost;

- Database encoding when creating tables: utf8;

- Matching scheme: utf8_general_ci;

It should look like this:

/ ** Database name for WordPress * / define ("DB_NAME", "blog"); / ** MySQL username * / define ("DB_USER", "root"); / ** MySQL user password * / define ("DB_PASSWORD", ""); / ** MySQL server address * / define ("DB_HOST", "localhost"); / ** Database encoding when creating tables. * / define ("DB_CHARSET", "utf8"); / ** Mapping scheme. Do not change if you are not sure. * / define ("DB_COLLATE", "utf8_general_ci");

We save and close the file.

It is important that all changes in the wp-config.php file are saved in UTF-8 encoding!

4. Go to the browser atblog.local and see the WordPress welcome page, enter the name of the blog and the administrator's e-mail (we can see all the letters in the sendmail folder, which was discussed above):


Click "Install WordPress" and get to the page with username and password:


Login to the blog administration panel:http: //blog.local/wp-admin/


Go to blog: http: //blog.local


You can also install WordPress in an alternative way, for this, after unpacking the archive with the engine and creating the database, type the name of your blog in the address bar of your browser, WordPress will offer to create a wp-config.php file through the web interface.

In conclusion, I want to say that I liked XAMPP very much in its work, it works quickly, there are no errors, the fact that some add-ons must be done manually, I consider only a plus.