Installing php 7.1 on windows. How to install local Apache server with Php, MySQL, phpMyAdmin on Windows machine

Php is a popular language for web programming and website development. With each new version the language became more and more interesting, it all started with a simple functionally oriented programming language suitable only for creating web pages, and finally Php 5 is now positioned as a fully functional objectively oriented scripting language. php 7 brings many interesting improvements and fixes such as total performance optimization and the addition of multithreading, but today is not about that, you can find a wagon and a small cart on the Internet for reviews of php 7 capabilities.

This tutorial will describe the installation of php 7 on Linux, it is designed primarily for Ubuntu users, but it will work for other distributions as well. We'll cover installing from PPA on Ubuntu and building from source.

PPA repositories allow third-party developers to distribute their software packages bypassing the official Ubuntu repositories. Usually the newest or even beta versions of programs can be obtained from the PPA. After the official release of php 7, a PPA was made for Ubuntu. Let's add it to the system:

$ sudo add-apt-repository ppa: ondrej / php-7.0

sudo apt-get update

And you can install:

sudo apt-get install php7.0

To support mysql, you need to install the library:

sudo apt-get install php7.0-mysql

To install php as an fpm module, run:

sudo apt-get install php7.0-fpm

Building php 7 from source

First, let's install the tools and libraries we need:

sudo apt-get install git autoconf bison libxml2 libxml2-dev opessllibcurl4-openssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libgmp-dev libmcrypt-dev libmysqld-dev libpspell-devrecode-dev

Let's create a working folder:

Synchronize php sources from the git repository:

git clone https://git.php.net/repository/php-src.git

We go directly to the assembly and installation, the program will be installed in the current folder - ~ / tmp:

cd php-src
$ sudo ./buildconf
$ sudo ./configure \
--enable-mbstring \
--enable-zip \
--enable-bcmath \
--enable-pcntl \
--enable-ftp \
--enable-exif \
--enable-calendar \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--with-curl \
--with-mcrypt \
--with-iconv \
--with-gmp \
--with-pspell \
--with-gd \
--with-jpeg-dir = / usr \
--with-png-dir = / usr \
--with-zlib-dir = / usr \
--with-xpm-dir = / usr \
--with-freetype-dir = / usr \
--with-t1lib = / usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-openssl \
--with-mysql = / usr \
--with-pdo-mysql = / usr \
--with-gettext = / usr \
--with-zlib = / usr \
--with-bz2 = / usr \
--with-recode = / usr \
--with-mysqli = / usr / bin / mysql_config
$ make

Create a folder for the configuration file:

mkdir $ HOME / tmp / usr / etc

We create a configuration php file with the following content:

nano $ HOME / tmp / usr / etc / php.ini

max_execution_time = 600
memory_limit = 128M
error_reporting = 0
display_errors = 0
log_errors = 0
user_ini.filename =
realpath_cache_size = 2M
cgi.check_shebang_line = 0
zend_extension = opcache.so
opcache.enable_cli = 1
opcache.save_comments = 0
opcache.fast_shutdown = 1
opcache.validate_timestamps = 1
opcache.revalidate_freq = 60
opcache.use_cwd = 1
opcache.max_accelerated_files = 100000
opcache.max_wasted_percentage = 5
opcache.memory_consumption = 128
opcache.consistency_checks = 0

Save and php 7 is installed and configured, you can proceed to testing.

Apache project does not provide binaries software, but only the source code. However, they can be obtained from third party sites:

  • ApacheHaus;
  • Apache Lounge.

Download Apache Windows 32-bit ( httpd-2.4.20-win32-VC14.zip) or 64-bit ( httpd-2.4.20-win64-VC14.zip). Check if you have installed 64-bit OS... You can use msinfo32.exe to determine this. This tool helps you gather information about your computer, diagnose problems, or you can use it to access other tools.

To run it, run the command Run> msinfo32> press Enter.

After you find the version you want, download the Zip archive and then extract its contents to the C: Apache24 folder.

Before starting the Apache server, if you need to change the listening port to 8181:

  • Open in text editor file C: Apache24confhttpd.conf;
  • Find the following line: Listen 80;
  • And change it to: Listen 8181.

Save your changes.

Now you can start the Apache Windows 7 server:

Open up command line as administrator and go to the bin subdirectory:

Enter httpd.exe and press Enter.

If a dialog box appears on the screen stating that the MSVCR140.dll file is missing, you need to install Visual C ++ Redistributable for Visual Studio 2015 (select vc_redist.x64.exe if you have installed 64-bit Windows version ).

Now open your browser and type in address bar http: // localhost: 8181 to start the demo site.

Installing PHP 7 on Windows

PHP 7 is an important update to the server-side web development language PHP. Download the VC14 x64 Thread Safe zip archive (2016-Apr-29 00:38:19). If you downloaded 32-bit Apache, PHP x86 must be installed.

Create a folder named " php7", Extract the contents of the php-7.0.6-Win32-VC14-x64.zip archive into it, and then place the folder in the root of the C drive:

Configuring Apache to Use PHP

Open the setup configuration file Windows Apache C: Apache24confhttpd.conf.

Copy the following lines to the top of the file:

  • AddHandler application / x-httpd-php.php;
  • AddType application / x-httpd-php .php .html;
  • LoadModule php7_module "c: /php7/php7apache2_4.dll";
  • PHPIniDir "c: / php7".

In chapter add the index.php line and place it before index.html:

DirectoryIndex index.php index.html

Save Apache file PHP Windows. Now rename the file C: php7php.ini-development to C: php7php.ini.

Enabling mod_rewrite for URL rewriting

Open the config file Apache C: Apache24confhttpd.conf;
Find the line in it #LoadModule rewrite_module modules / mod_rewrite.so and remove the hash "#";
Find all occurrences of the string " AllowOverride None"And change them to" AllowOverride All ".

PHP setup with MySQL

Edit the php.ini file and uncomment the extensions directory. Remove the “; "At the beginning of the lines:

; Directory in which the loadable extensions (modules) reside. ; http://php.net/extension-dir; extension_dir = "./"; On windows: extension_dir = "ext"

Activate the following lines, this will enable MySQL modules to run:

extension = php_mysqli.dll extension = php_pdo_mysql.dll

And also the below lines if you are using Apache PHP MySQL Window s installation in a development environment:

extension = php_curl.dll extension = php_fileinfo.dll extension = php_gd2.dll extension = php_mbstring.dll extension = php_openssl.dll

Uncomment error_log to enable file logging:

; Log errors to specified file. PHP "s default behavior is to leave this value; empty.; Http://php.net/error-log; Example: error_log = c: php7php_errors.log

Save your changes.

IMPORTANT! Set PATH for Windows to find PHP

  • Click right click mouse on the shortcut My Computer - Properties - Advanced - Environment Variables;
  • In chapter " System Variables"Find the item" Path ", click on it and select" Change ";
  • Add the php folder path at the end ( required after a semicolon ";"). For example: "; C: php7";
  • Click OK.

How to check if PHP is installed

Create a file at C: Apache24htdocsphpinfo.php and add the following code to it:

Restart Apache Windows and then in your browser navigate to http: // localhost: 8181 / phpinfo.php... This page should display information about installed version PHHP.

To download the Windows distribution of PHP 7, visit the download section binary files official site of PHP. Each release comes with four options:

  • х86 Non Thread Safe- 32-bit CGI version of the distribution kit;
  • x86 Thread Safe- 32-bit version for installation as a Web server module;
  • х64 Non Thread Safe- 64-bit CGI version of the distribution kit;
  • x64 Thread Safe- 64-bit version for installation as a Web server module.

Option Thread Safe designed to safely execute PHP 7 in parallel threads within one system process for example, if PHP is installed as a module of the Apache web server. Since we are going to use the built-in server, it doesn't matter which distribution you choose, it is best to use the option Non Thread Safe... The latter option is also used when connecting PHP as an external FastCGI application, which is launched for each external request.

One of the abbreviations VC11, VC14 can be placed before the name of the distribution, meaning the versions of Visual Studio (2012 and 2015, respectively), with which the distribution was compiled. To run the project successfully, download the appropriate Visual C ++ Redistributable Package for Visual Studio, which contains the required dynamic libraries:

Attention!

Libraries are required from the English version of Visual Studio, the Russian version of the package will not work.

After downloading the zip archive, it should be unpacked into some folder, for example C: \ php.

You can make sure that PHP 7 is available by running the command line, and then go to the C: \ php folder using the command

> cd C: \ php

By running the php command on the command line with the -v parameter, you can find out the current version of PHP:

> php -v PHP 7.0.0 (cli) (built: Dec 3 2015 09:31:54) (NTS) Copyright (c) 1997-2015 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

In order for the PHP team to be available anywhere file system, the path to the PHP interpreter should be written in the path environment variable.

To access the environment variables, you need to open the Control Panel, go to the section System... Most quick way to get to this point is to right-click on the button Start and select item System from the context menu. On operating systems prior to Windows 8, select from the menu Start paragraph A computer and in context menu select item Properties... In the opened Control Panel window with the active section System on the left click on the link Extra options systems... Then, in the System Properties window on the Additional tab, click the button Environment Variables... In the dialog box that opens, under System Variables find the path environment variable and supplement it with the path to the C: \ php directory. The individual paths in the value of the path variable are separated by semicolons (no semicolons are required at the end of the entire line). After that, the php command will be available in any folder on the computer.

Installing a web server on Linux:

  • If you have Ubuntu, the article "How to Install Apache Web Server with PHP 7, MariaDB / MySQL and phpMyAdmin (LAMP) on Ubuntu 16.10" is for you.
  • If you have Arch Linux, then the article "Installing LAMP (Linux, Apache, MySQL / MariaDB, PHP7 and phpMyAdmin) on Arch Linux / BlackArch" will suit you.

Local server very useful tool... It will definitely come in handy for webmasters, PHP programmers, penetration testers. All programs included in typical installation web servers are free, all of them are open source. A local web server consumes a minimum of resources and, in fact, is not difficult to install and configure.

This guide will show you how to install a local web server without using prebuilt assemblies. This method has its advantages. The most important of these are: complete control over what you install; opportunity to use the most latest versions software.

If you follow the instructions exactly, then everything will definitely work for you! Except for those who have Windows XP - if you have this operating system, then a special instruction has been made for you.

I will show an example of installation on Windows 10, but if you have a different version of Windows, then don't be confused by this - the procedure is the same everywhere. I will download the latest (freshest) versions of the programs at the time of writing. If by the time you read there are new versions, then download them.

Installation steps:

You may also find it useful:

1. Preparation (downloading programs included in the server, creating the server structure)

We need:

  • Apache(web server directly)
  • PHP- environment for PHP programs (required by almost all websites)
  • MySQL- database management system (required by most websites)
  • phpMyAdmin- very handy tool for database management

The official website for the Apache developers is httpd.apache.org. You can download Apache from this site. But official version builds using the old compiler, for this reason it does not work with newer versions of PHP. The PHP authors recommend Apache from apachelounge.com/download. Therefore, for this instruction, we download Apache from apachelounge.com/download.

If you have a 64-bit version of Windows, then you can choose both 64-bit and 32-bit versions of the components. The main rule is that all components must be of the same bitness. If you have a 32-bit version of Windows, then all components must be 32-bit. This is not the case for phpMyAdmin, which is written in PHP. For PHP programs, the concept of bitness is not applicable.

The free version of MySQL is called MySQL Community Server... It can be downloaded on the page. There is an executable installer on the same page, but I recommend downloading the ZIP archive. On the download page, we are offered to register or enter an existing one account- but this is optional. It is enough to click on the link “ No thanks, just start my download". Pay attention to the bitness.

We also need the Visual C ++ Redistributable for Visual Studio 2015-2019 file, i.e. Visual C ++ Redistributable Component for Visual Studio 2015-2019 (or any other later), you can download it on the official Microsoft website at the link (direct link to download the 64-bit version; direct link to download the 32-bit version).

So, I downloaded the following files:

  • httpd-2.4.29-Win64-VC15.zip
  • php-7.2.0-Win32-VC15-x64.zip
  • mysql-8.0.11-winx64.zip
  • phpMyAdmin-4.7.6-all-languages.zip
  • vc_redist.x64.exe

Install the file vc_redist.x64.exe.

2. Creation of the structure of the web server

Let's create the directory structure of our server. The main idea is to share executable files and site files with databases. This is convenient for server maintenance, including backups.

At the root of the disk C: \ create a directory Server... In this directory, create 2 subdirectories: bin(for executable files) and data.

Go to the directory data and create subfolders there DB(for databases) and htdocs(for sites).

Go to the directory C: \ Server \ data \ DB \ and create an empty folder there data.

Map of important folders that are mentioned in this manual:

C :. ├───bin │ ├───-Apache24 │ │ └───conf │ ├───-mysql-8.0 │ ├───-PHP │ └───-Sendmail ├───certs ├── ─data │ ├───DB │ │ └───data │ └───htdocs │ └───-phpmyadmin └───manage

3. Installing Apache 2.4

The contents of the downloaded archive (more precisely, only the directory Apache24), unpack into C: \ Server \ bin \.

Go to the directory c: \ Server \ bin \ Apache24 \ conf \ and open the file httpd.conf any text editor.

In it, we need to replace a number of lines.

Define SRVROOT "c: / Apache24"

Define SRVROOT "c: / Server / bin / Apache24"

#ServerName www.example.com:80

ServerName localhost

DocumentRoot "$ (SRVROOT) / htdocs"

DocumentRoot "c: / Server / data / htdocs /"

DirectoryIndex index.html

DirectoryIndex index.php index.html index.htm

# AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride None

# AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # AllowOverride FileInfo AuthConfig Limit # AllowOverride All

#LoadModule rewrite_module modules / mod_rewrite.so

LoadModule rewrite_module modules / mod_rewrite.so

We save and close the file. Everything, Apache setup completed! You can find a description of each changed directive on this page.

Open a command prompt (you can do this by pressing the Win + X keys at the same time). Select Windows PowerShell (administrator) there and copy there:

C: \ Server \ bin \ Apache24 \ bin \ httpd.exe -k install

If you get a request from the firewall regarding Apache, then click Allow.

Now we enter into the command line:

C: \ Server \ bin \ Apache24 \ bin \ httpd.exe -k start

And press Enter.

Enter root as the username. Leave the password field blank. If everything is done correctly, then everything should look like this:

7. Server usage and data backup

In the catalog c: \ Server \ data \ htdocs \ create folders and files, for example:

c: \ Server \ data \ htdocs \ test \ ajax.php - this file, respectively, will be available at http: //localhost/test/ajax.php, etc.

To create a full backup of all sites and databases, just copy the directory C: \ Server \ data \.

Before updating modules, make a backup of the folder bin- in case of problems, you can easily roll back to previous versions.

When reinstalling the server or updating it, you need to re-configure the configuration files. If you have copies of these files, the process can be greatly accelerated. It is advisable to back up the following files:

  • c: \ Server \ bin \ Apache24 \ conf \ httpd.conf
  • c: \ Server \ bin \ mysql-8.0 \ my.ini
  • c: \ Server \ bin \ PHP \ php.ini
  • c: \ Server \ data \ htdocs \ phpMyAdmin \ config.inc.php

All settings are stored in them.

8. Additional PHP configuration

PHP is currently a very powerful, flexible, user-friendly tool. On local computer it can be used to solve a variety of tasks, not necessarily related to the generation of Web-pages. When solving extraordinary tasks, you can run into the restrictions set in the settings. These settings are contained in the php.ini file (c: \ Server \ bin \ PHP \ php.ini) Let's look at some of them:

Memory_limit = 128M

sets maximum amount memory that the script can use

Post_max_size = 8M

sets the maximum amount of data that will be accepted when sent by the POST method

; default_charset = "UTF-8"

sets the encoding (by default, the line is commented out)

Upload_max_filesize = 2M

the maximum size of the file uploaded to the server. Initially set to a very small size - only two megabytes. For example, when loading a database in phpMyAdmin, it will not be possible to load a file larger than 2 megabytes until this configuration item is changed.

Max_file_uploads = 20

maximum number of files to upload at one time

Max_execution_time = 30

maximum execution time of one script

It is completely optional to change these settings, but it is good to know about them.

9. Additional phpMyAdmin configuration

We have already configured phpMyAdmin and the basic functionality is enough for most. However, on start page phpMyAdmin has an inscription: "Additional features of phpMyAdmin are not fully configured, some features have been disabled."

New features are:

  • showing relationships between (linked) tables;
  • adding information about tables (starting from version 2.3.0 you can describe in a special table 'table_info' which column will be shown in the tooltip when moving the cursor over the associated key);
  • creating a PDF schema (starting from version 2.3.0 you can create in phpMyAdmin PDF pages showing the relationships between your tables);
  • display column comments (since version 2.3.0 you can make a comment describing each column for each table. And they will be visible in " preview for print". Since version 2.5.0, comments are used on their own table pages and in view mode, shown as tooltips above columns (property tables) or embedded in the table header in view mode. They can also be shown in the table dump);
  • create bookmarks (since version 2.2.0, phpMyAdmin allows users to bookmark queries. This can be useful for frequently used queries);
  • history of SQL queries (since version 2.5.0 you can save your history of all SQL queries which were made through the phpMyAdmin interface);
  • designer (since version 2.10.0, the Designer tool is available; it allows you to visually manage relationships between tables);
  • information about recently used tables;
  • customizing the interface of frequently used tables;
  • tracking (since version 3.3.x a tracking mechanism is available. It helps you to trace every SQL command that was executed by phpMyAdmin. It supports data recording and command recording. After enabling, you can make table versions);
  • custom settings (since version 3.4.x, phpMyAdmin allows users to define most of the settings and save them in the database);
  • custom menus (starting from version 4.1.0 you can create user groups to whom only assigned menu items will be available. A user can be assigned to a group and will see only menu items available for his group);
  • hide / show navigation items (since version 4.1.0 you can hide / show items in the navigation tree).
  • other

We will now set up these additional features fully. Follow the link http: //localhost/phpmyadmin/chk_rel.php and click "Create Database". After that, all new functions will be activated.

Several screenshots of new features:

1) Designer

2) Tracking

10. Installing a mail plug

In the C: \ Server \ bin \ directory, create a new directory called Sendmail. Now in this directory create a sendmail.php file with the following content:

#! / usr / bin / env php

Open the PHP config file, it is located here C: \ Server \ bin \ PHP \ php.ini... And add one line there:

Sendmail_path = "C: \ Server \ bin \ PHP \ php.exe C: \ Server \ bin \ Sendmail \ sendmail.php --dir C: \ Server \ bin \ Sendmail \ emails"

Save the file and restart the server. Great, now all sent emails will be saved in the directory C: \ Server \ bin \ Sendmail \ emails \

Letters will have the extension .eml and they can be opened, for example, with the program Thunderbird... Or with an ordinary text editor.

11. Adding PHP directory to PATH on Windows

If this is not done, there may be problems with some PHP modules, including php_curl.dll, php_intl.dll, php_ldap.dll, php_pdo_pgsql.dll, and php_pgsql.dll. At least when starting the server, the following appears in the logs every time:

PHP Warning: PHP Startup: Unable to load dynamic library "C: \\ Server \\ bin \\ PHP \\ ext \\ php_curl.dll" - \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd. \ r \ n in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library "C: \\ Server \\ bin \\ PHP \\ ext \\ php_intl.dll "- \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd. \ r \ n in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library " C: \\ Server \\ bin \\ PHP \\ ext \\ php_ldap.dll "- \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xb d \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd. \ r \ n in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library "C: \\ Server \\ bin \\ PHP \\ ext \\ php_pdo_pgsql .dll "- \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd. \ r \ n in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library "C: \\ Server \\ bin \\ PHP \\ ext \\ php_pgsql.dll" - \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd \ xef \ xbf \ xbd. \ r \ n in Unknown on line 0

To avoid these warnings, you need to add the path to PHP to your system environment variables.

Click the Start button (or what is it called on Windows 10?), Start typing " Changing system environment variables»And open the corresponding settings window.

There click " Environment Variables»:

In the window " System Variables»Find and click on Path, then click " Change»:

Raise the entry to the very top:

Close all windows and save your changes.

Restart the server.

12. Freezing, traffic slowdown and / or server error Asynchronous AcceptEx failed

If your server "freezes" even without a load, it does not show the web page until the restart, and the server logs contain Asynchronous AcceptEx failed errors:

AH00455: Apache / 2.4.9 (Win64) PHP / 5.5.13 configured - resuming normal operations AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:42:59 AH00094: Command line: "c: \\ Server \\ bin \\ Apache24 \\ bin \\ httpd.exe -d C: / Server / bin / Apache24 "AH00418: Parent: Created child process 4952 AH00354: Child: Starting 64 worker threads. (OS 64) The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed. (OS 64) The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed. (OS 64) The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed. (OS 64) The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed. (OS 64) The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed. (OS 64) The specified network name is no longer available. : AH00341: winnt_accept: Asynchronous AcceptEx failed.

Then add to the Apache config file:

AcceptFilter http none AcceptFilter https none EnableSendfile off EnableMMAP off

13. Configuring cURL in Apache web server on Windows

If you don't know what cURL is, then you don't need it. Those. feel free to skip this step.

cURL is a console utility that allows you to communicate with remote servers using a very large number of protocols. cURL can use cookies and supports authentication. If the web application requires cURL, then this must be specified in the dependencies. Many popular applications do not require cURL, for example phpMyAdmin and WordPress there is no need to configure cURL.

If cURL is not configured correctly, then you will receive errors:

Fatal error: Call to undefined function curl_multi_init () in ...

Curl error: SSL certificate problem: unable to get local issuer certificate

For cURL to work in Apache on Windows, you need:

1) Be sure to add PHP directory to PATH (system environment variables). How to do this is stated just above:

2) In the file C: \ Server \ bin \ PHP \ php.ini the line should be uncommented extension = curl

This is usually not required, but if you wish, you can make a backup copy of the server's binary (executable) files. All these files are in the folder C: \ Server \ bin \... These are Apache, MySQL and PHP - i.e. programs that are responsible for the operation of the server, but which we can download from the official sites at any time and re-configure.

If you want to make a backup copy of them (for example, before updating the server), then stop the services:

C: \ Server \ bin \ Apache24 \ bin \ httpd.exe -k stop net stop mysql

And copy the folder to a safe place C: \ Server \ bin \.

By the way, you can copy the entire server as a whole, i.e. folder C: \ Server \- in this case, you will simultaneously get a backup copy of both executable files and data (databases, sites).

When copying is complete, start the services again:

C: \ Server \ bin \ Apache24 \ bin \ httpd.exe -k start net start mysql

15. Server update

All the components that make up the web server are actively developing and new versions are regularly released. When a new version is released, you can update one component (for example, PHP), or several at once.

Removing a server

If you no longer need a server, or you want to reinstall it, stop the services and remove them from autostart by sequentially executing in the command line:

C: \ Server \ bin \ Apache24 \ bin \ httpd.exe -k stop c: \ Server \ bin \ Apache24 \ bin \ httpd.exe -k uninstall net stop mysql c: \ Server \ bin \ mysql-8.0 \ bin \ mysqld --remove

In the past, there was a great tutorial on how to set up a LEMP stack on a server from scratch. Unfortunately, this material has sunk into oblivion during the transfer of articles, and I had no desire to write it again.

UPD: The new version of the language, - PHP 7.3, -.

The stable version 7.2 was released at the end of November. There are quite a few changes, but now it's not about them. Below is a simple way I used to update my existing one PHP 7.1 FPM to PHP 7.2 FPM.

1. Add the repository.

sudo add-apt-repository ppa: ondrej / php sudo apt update

2. Install packages.

sudo apt install php7.2 php7.2-common php7.2-cli php7.2-fpm php7.2-gd php7.2-mysql php7.2-curl php7.2-simplexml php7.2-zip

Dpkg -l | grep php | tee packages.txt

The current packages will be saved in packages.txt... After installing the new version of PHP, open the file and compare the list of installed packages.

3. PHP configuration.

We open /etc/php/7.2/fpm/pool.d/www.conf, change the value of the parameter listen:

Listen = 127.0.0.1:9000

4. NGINX configuration

If you already have the FPM package installed, there is no need to make any changes. Otherwise, add \ change in the site config:

Location ~ \ .php $ (try_files $ uri = 404; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; fastcgi_index index.php; include fastcgi_params;)

5. Delete old PHP files.

If everything went well and php -v claims that you are using the required version of PHP, delete old files as unnecessary with the command:

Sudo apt purge php7.1 *

5. Well, everyone.

Do not forget to restart the services after all the changes.

Service nginx restart service php7.2-fpm restart

That's all. Enjoy the new PHP 7.2 :)