Installing PHP on your local computer. Installing a mail stub


Last update: 16.12.2017

Eat different ways installation of everything necessary software. We can install components separately, or we can use ready-made assemblies like Denwer or EasyPHP. In such assemblies, the components already have initial setup and are already ready to create websites. However, sooner or later developers still have to resort to installation and configuration individual components, connecting other modules. Therefore, we will install all components separately. Windows will be used as the operating system.

What does installing PHP involve? Firstly, we need PHP interpreter. Secondly, we need a web server, for example, Apache, with which we can access the resources of the site we are creating. Third, since we will be using databases, we will also need to install some kind of database management system. MySQL was chosen as the most popular in conjunction with PHP.

To install PHP, let's go to the developers' website http://php.net/. On the downloads page we can find various distributions for the operating system Linux systems. If our operating system is Windows, then we need to download one of the packages from the page http://windows.php.net/download/.

Download the zip package of the latest PHP release:

Usually, latest issue PHP has two versions: Non Thread Safe and Thread Safe. We need to select the Thread Safe version. This version has options for 32-bit and 64-bit systems.

Let's unpack the downloaded archive into a folder called php. Let this folder be located at the root of drive C.

Now we need to execute minimal configuration PHP. To do this, go to the c:\php directory and find the file there php.ini-development. This is the initial configuration file for the interpreter. Let's rename this file to php.ini and then open it in a text editor.

Let's find the line in the file:

; extension_dir = "ext"

This line points to the directory with plug-in extensions for PHP. Let's uncomment it (removing the semicolon):

Extension_dir = "ext"

Since all extensions are in the ext directory.

Since we will be using bases MySQL data, then we need to specify the extension in php.ini. By default, it is already in the file, only it is commented out:

;extension=mysqli

Let's uncomment it by removing the semicolon:

Extension=mysqli

Now by default this library will be used when working with the database. We can also uncomment other extensions if necessary. But for starters, one is enough for us.

We will leave the rest of the file contents unchanged.

Now let's install the web server.

In this article we will look at installing and configuring a Web server Apache, PHP 5 And MySQL DBMS to use them on local machine under the operating room Windows system(2000 and XP). Usage local servers may be needed for many reasons - you need to learn PHP or MySQL, and testing your Web applications on hosting is either expensive or there is no such opportunity at all. In this case, you will need Apache+PHP+MySQL on your local machine.

First you need to get distributions of Apache and MySQL servers, as well as a PHP archive. We will be installing and configuring Apache 2, MySQL 4 and PHP 5.

You can also download php.ini files for configuring PHP and httpd.conf for Apache from our website. However, do this only as a last resort - if nothing worked out for you with the “native” files that appeared when installing applications. But in any case, they will need to be configured for a specific machine. Download php.ini and httpd.conf

You can download Apache from the mirrors provided on the official website http://www.apache.org/dyn/closer.cgi. When searching, remember that Apache can also be called httpd, after the name of its daemon in UNIX. There are usually a lot on mirrors various files, For example:
httpd-2.0.49-win32-src.zip is an archive with source codes(src) for Windows (win32) Apache Web server (httpd) version 2.0.49.
httpd-2.0.49.tar.gz is the same, but for Linux, in which programs are usually distributed in source code.
apache_2.0.50-win32-x86-no_ssl.exe - and here is the Apache server (apache) version 2.0.50 compiled for the architecture (x86) for Windows (win32) without SSL support (no_ssl) - this is what you need.

Comment

Binary codes Apache distributions are distributed in several versions, both with *.exe and *.msi extensions and have a name like httpd_version_win32_*_.msi.

So that you don't have to suffer, here is a resource where you can get it: http://apache.rinet.ru/dist/httpd/binaries/win32/
The second and third digits in the version may differ from those given here - you should choose the latest version, as it eliminates errors found in previous versions.

PHP 5 can be downloaded from the section of our website.

The MySQL distribution can be downloaded from our website.

Complete reference guide in Russian can be found at .

Once we have stocked up on all the necessary distributions, we can begin installation. Order Apache installations, PHP and MySQL doesn't matter. Let's start with the Apache Web server.

Installing Apache Web Server

Run the Apache Web Server installer. The result will be a window with license agreement, after accepting which, you should go to the next window with brief information about innovations in the second version of Apache. The following window, shown in the figure, allows you to enter information about the server: Domain name servers, server name And address Email administrator. If the installation takes place on a local machine, then in the fields for the domain name and server name you should enter localhost(see picture.). At the bottom of the window you are prompted to select port number by which the server will accept requests (80 or 8080).


localhost is the name for using the server on the local machine, which is associated with the IP address 127.0.0.1, which is reserved for local use.

After this, the installation method will be suggested: standard ( Typical) or selective ( Custom), which allows you to manually select server components. The next window allows you to select the server installation directory, by default it is C:Program FilesApache Group, but we recommend choosing a different directory, for example, C:www. After this, the installation wizard will inform you that it is ready for the installation process and after clicking the button Install, the server files will be copied. If the installation was successful, Windows will automatically launch Apache.

After successful installation, when you type http://localhost/ or http://127.0.0.1/ in the browser window, the server page should load.

Now you need to learn how to manage Apache, namely, learn how to start, stop and restart the server. There are many ways to carry out these operations: using the ApacheMonitor utility, using the management console Windows services using the Start menu items from command line... We will look at the Windows services management console, which allows you to configure Apache for automatic start when the system starts. To launch the management console, run the command
Start->Settings->Control Panel->Administration->Services.
In the console window that appears, in the figure below, select the Apache2 service. The context menu, which opens by clicking on the right button, allows you to start, stop and restart the service.


Windows Services allow launch background applications at system startup. To do this, go to the Properties window by selecting context menu service point Properties and in the window that appears in the drop-down list " Startup type"select item" Auto".

Configuring Apache

Web server is complex software working for different platforms and in different operating systems Worldwide. Therefore for correct operation on installed system it needs to be configured.
By default, Apache settings are located in the httpd.conf file in the conf directory. The following will describe the main directives of the httpd.conf file and their commonly used meanings.

File paths

In Apache and PHP configuration files, you will often have to specify paths to various directories and folders. In operating rooms UNIX systems and Windows use different directory separators. UNIX uses a forward slash "/", for example /usr/bin/perl, while Windows uses a backslash, for example c:Apachein. In general, in some Apache directives and PHP, both types of directory separators work: forward (/) and reverse (), but since both Apache and PHP were originally developed for UNIX, using their “native” format, you can avoid a number of problems. Therefore, it is recommended to write paths in configuration files (httpd.conf and php.ini) using a slash in the UNIX format - “/”. For example:

ScriptAlias ​​"/php_dir/" "c:/php/"

httpd.conf file directives

Port

Port 80

Installs TCP port, which is used by Apache to establish a connection. By default, port 80 is used.

Note

The only reason to use standard port- this is the lack of rights to use a standard port. When using a non-standard port, for example, 8080, the port number should be specified in the address, for example: http://localhost:8080/.

ServerAdmin

ServerAdmin [email protected]

Contains the e-mail address of the web server administrator, which will be displayed in case of server errors.

ServerName

ServerName myserver

Contains the computer name for the server.

ServerRoot

ServerRoot "C:/Apache2"

Points to the directory containing Apache WEB server files.

Note

Do not confuse the ServerRoot directive with the DocumentRoot directive, which specifies the directory for the WEB site files.

DocumentRoot

DocumentRoot "C:/Apache2/htdocs"

Defines the directory in which the WEB site files are located.

Container

The scope of directives within this container extends to all files and subdirectories within DocumentRoot.


Options FollowSymLinks Includes Indexes
AllowOverride All

  • The AllowOverride directive set to All allows you to override the values ​​of the main httpd.conf configuration file in .htaccess files.
  • The Options FollowSymLinks directive allows Apache to follow symbolic links.
  • The Options Includes directive allows execution SSI directives(Server Side Includes) in the code of the website pages.
  • The Options Indexes directive specifies that the contents of a directory should be returned if an index file is missing.

DirectoryIndex

DirectoryIndex index.html index.phtml index.php

Contains a list of index files that should be displayed when accessing a directory without specifying a file name (for example, http://localhost/test/).

AddDefaultCharset

AddDefaultCharset windows-1251

Sets the default encoding if no encoding is set in the head of the HTML document. You may also need to specify the KOI8-R encoding value.

Creating virtual hosts

You can install several WEB sites on one Apache WEB server. This server function is called virtual hosting. Below we will look at creating virtual nodes based on names. Virtual hosts are usually located at the end of the httpd.conf file.

First you need to specify which IP address is used for the virtual hosts.



# Directives virtual host

httpd.conf file. Container


ServerAdmin webmaster@may_domain.ru
DocumentRoot c:/www/mysite
ServerName www.mysite.ru
ServerAlias ​​www.site.ru www.host2.ru
ErrorLog logs/mysite-error.log
CustomLog logs/mysite-access.log common

Let's look at the virtual node directives:

  • DocumentRoot indicates the directory where the files (pages) of this virtual node (WEB site) are located
  • ServerName specifies the name of the virtual host by which it can be accessed. IN in this case, at http://www.mysite.ru/.
  • ServerAlias ​​contains virtual host name aliases. In this case, you can also access the virtual host using the names: http://www.site.ru/ and http://www.host2.ru/.
  • ErrorLog and CustomLog specifies the server log names for this virtual host.

Containers are usually placed one after the other at the end of the httpd.conf file.

httpd.conf file. Setting up virtual hosts

NameVirtualHost 127.0.0.1:80

# Virtual host 1 directives


# Virtual host directives 2


# Virtual host directives 3

Note

Apache must be restarted for changes made to the httpd.conf file to take effect.

In order to access virtual hosts by name, they must be registered in the DNS server database. If you use Apache to test files on a local machine, then the names of your virtual nodes should be written in the hosts file. For Windows 2000 and XP, it is located in the C:WindowSystem32Driversets directory. The hosts file contains entries like:

Hosts File Entry Format

127.0.0.1 www.mysite.ru
127.0.0.1 www.site.ru
127.0.0.1 www.host2.ru

Installing and configuring PHP

To install PHP, you should create a directory c:/php and place the files from the distribution zip archive in it. After this you should rename configuration file php.ini-dist to php.ini and copy it to the Windows directory.

Installing PHP as a module

Installing PHP as a module improves performance slightly because the PHP module is loaded once when the Web server starts

Comment

When installing PHP as a module, the settings from php.ini are read once when the Web server starts. Therefore, when making changes to php.ini, you need to restart Apache in order to changes made came into force.

To install PHP, open the main configuration file Apache file httpd.conf to edit and remove the comment characters from the following lines, changing them if necessary:

httpd.conf file. Connecting PHP as an Apache module


LoadModule php5_module c:/php/php5apache2.dll

Note

Installing PHP as a CGI Application

When installing PHP as a CGI application, the PHP interpreter will be loaded every time the PHP script is called. Due to this, there may be some deterioration in performance. If PHP is installed as CGI, then Apache should not be restarted when making changes to the php.ini file, since the settings are read every time the PHP script is executed. Installing PHP as CGI makes making changes to the PHP configuration a little faster, since it does not require restarting the WEB server.

Note

When installing PHP as CGI, some headers will stop working, for example, you will not be able to authorize users using PHP. Authorizations can only be implemented using Apache itself using .htaccess files.

To install PHP, open the main configuration file httpd.conf for editing, find the commented PHP connection lines in it and change them as follows:

httpd.conf file. Connecting PHP as CGI

AddType application/x-httpd-php phtml php

OptionsExecCGI

ScriptAlias ​​"/php_dir/" "c:/php/"
Action application/x-httpd-php "/php_dir/php-cgi.exe"

Note

Instead of the c:/php directory, substitute your directory with PHP installed.

Configuring PHP (php.ini file)

Since you will most likely be busy testing your Web applications on your local machine, you need to properly configure the php.ini configuration file. Find the error_reporting directive and set it to the following value:

This value will configure PHP so that when running PHP scripts, all errors will be displayed, and "comments" will be ignored. You also need to make sure that the display_errors directive is enabled:

Display_errors = On

If this directive is disabled (Off), then error messages will not be displayed in the browser window and if an error occurs in the code, you will wonder in front of a pristine white window what it would mean.
It is also necessary to ensure that the variables_order directive has the following meaning:

Variables_order = "EGPCS"

The letters here mean the following:
E - environment variables
G - variables transmitted using the GET method (G)
P - variables transmitted via to the POST method(P)
C - Cookies
S - sessions
Missing any of the letters will prevent you from working with the corresponding variables.

The next directive that may require configuration is register_globals. If this directive is enabled

Register_globals = On

then the variables transmitted by the GET, POST, cookies and sessions can be used in a PHP script, accessing them simply as ordinary $someone variables.
If this directive is disabled

Register_globals = Off

then such variables can only be accessed using superglobal arrays ($_POST, $_GET, etc.).
Directive register_long_arrays allows you to use superglobal arrays in the old format ("long" - $HTTP_GET_VARS, $HTTP_POST_VARS, etc.)

Register_long_arrays = On

Now you need to configure the index file. If you type the line http://localhost/ in the browser window, and not http://localhost/index.html. The server will still provide the browser with index.html, since this file is the index file and is searched first in the directory if not specified specific file. Now you need to configure http.conf so that Apache Web Server reacted the same way to index.php files. To do this, find the DirectoryIndex directive in http.conf and correct it as follows:

DirectoryIndex index.html index.html.var index.php

After this, you need to restart the Apache server, and create a test PHP file (index.php) in the root directory of the virtual host ("C:/www/scripts"):

phpinfo();
?>

If the setup is successful, accessing http://localhost/index.php will display a purple table with the current PHP settings, which is returned by the phpinfo() function.
Thus, we have configured a combination of Apache and PHP and we can move on to MySQL setup. Unpack the MySQL distribution into a temporary directory and run the installer. You can control the operation of the MySQL server in the same way as Apache, using the Windows services management console.

MySQL connection

A detailed method for connecting the MySQL extension to PHP is described in the article at the link: .

If MySQL server is already installed on your machine, then the next step is PHP setup for working with MySQL databases.

Open the php.ini file from the Windows directory for editing. To connect the MySQL extension library, you need to remove the comment character (semicolon) from the line:

Extension=php_mysql.dll

Also check the value of the extension_dir directive

Extension_dir="c:/php-5.0/ext"

It should point to the directory where PHP extensions are stored. It is recommended to write directory separators in UNIX format (/) - backslash. However, if all else fails, simply roll back the value of the extension_dir directive and copy the php_mysql.dll library to the root of C:/php-5.0/ - in most cases this should help.

If PHP is connected to you as a module, then you also need to copy the libmysql.dll library from the directory with PHP installed in system directory C:/Windows/System32. For the changes to take effect, restart Apache.

To check that MySQL is working, restart the Apache server and create a test script with the following code:

$dblocation = "127.0.0.1" ;
$dbname = "test" ;
$dbuser = "root" ;
$dbpasswd = "" ;

$dbcnx = @mysql_connect ($dblocation, $dbuser, $dbpasswd);
if (! $dbcnx )
{
echo "

Unfortunately, the mySQL server is not available

" ;
exit();
}
if (!@
mysql_select_db ($dbname, $dbcnx))
{
echo "

Unfortunately, the database is not available

"
;
exit();
}
$ver = mysql_query("SELECT VERSION()" );
if(!$ver)
{
echo "

Error in request

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

If MySQL is successfully integrated into the Apache and PHP combination, accessing the test script will display the MySQL server version in the browser window.

In new MySQL versions(starting from 4.1.0) the procedure for working with national encodings has changed, so old code may cause question marks "?????????" to appear in a database table. instead of Russian text. To prevent this from happening at the beginning of the PHP script, after establishing a connection to the database, you should place the following lines:

mysql_query( "set character_set_client="cp1251"");
mysql_query( "set character_set_results="cp1251"");
mysql_query( "set collation_connection="cp1251_general_ci"");
?>

Installing PHP extensions

Lastly, you may need to configure some PHP extensions; they are configured in the same way as MySQL.

So in order to connect graphics library GDLib in php.ini you need to uncomment the line:

Extension=php_gd2.dll

After this, check the presence of this library in the c:phpext folder. After making changes to php.ini, restart the server. To quickly check whether the library is connected, run the phpinfo() function. If everything is in order, then the section " should appear in the table that is displayed by the phpinfo() functions gd

If you use an outdated php.exe name that was used in more earlier versions Instead of php-cgi.exe, the following error may also appear:

403 Forbidden You don"t have permission to access /__php_dir__/php.exe/test.php on this server

HTML files are executed, but PHP scripts are not

With an unconfigured PHP connection, when accessing files with php extension, for example: http:/localohost/index.php a window opens with a request to download such a file. This indicates that processing of files with the php extension is not configured. Check the httpd.conf file for existence next line:

AddType application/x-httpd-php phtml php

Notice: Undefined variable...

On a new, newly installed PHP, you can often see messages like:

Notice: Undefined variable: msg in C:/Main/addrec.php on line 7

Error_reporting = E_ALL & ~E_NOTICE

MySQL won't connect

Sometimes there are problems installing MySQL. You should check whether MySQL starts as a service every time the system starts. To do this, open the services console:

Start | Setting | Control Panel | Administration | Services

find MySQL there - run it. To start the server every time the system boots, click right button mouse on the service and select "Properties" - in the "Startup type" drop-down list that opens, select "Auto".

If, when starting Apache and accessing scripts, a message appears indicating that the php_mysql.dll library cannot be loaded.

PHP startup: Unable to load dynamic library c:/php/ext/php_mysql.dll
- the specified module was not found

Then again check the instructions in the section that describes connecting to PHP libraries for working with MySQL. Are you using the "correct" version? php file _mysql.dll (exactly for the version of PHP that is installed on the system)?
The versions of the php_mysql.dll file differ for different versions PHP, although they have the same name.

  • Using directory separators Windows format(backslash): c:apache/bin. For reliable operation, you should use UNIX delimiters (forward slash), for example: c:/apache/bin.
  • The existence of several php.ini configuration files on the machine, or the absence of such a file. Required file php.ini should be located in the Windows directory. Search your computer drives, find everything extra versions files and delete them.
  • You can ask any questions you may have about installing the Apache+PHP+MySQL combination on our forum dedicated to installing and configuring Apache, PHP and extension libraries.

    » Installing PHP under Windows OS

    Installing PHP under Windows OS

    PHP (English PHP: Hypertext Preprocessor - “PHP: hypertext preprocessor”) is a programming language created for generating HTML pages on a web server and working with databases. Currently supported by the vast majority of hosting providers.

    PHP was created specifically for Web development and can be used directly in HTML code. The language's syntax comes from C, Java and Perl and is easy to learn. Preferential PHP purpose is to provide web developers with the opportunity quick creation dynamically generated web pages, however, the scope of PHP is not limited to this.

    In the field of Internet programming, PHP is one of the most popular scripting languages ​​due to its simplicity, speed of execution, rich functionality and distribution of source codes based on the PHP license. PHP is currently used by hundreds of thousands of developers. About 20 million websites use PHP.

    A Brief History of PHP.

    In 1994, Danish programmer Rasmus Lerdorf wrote a set of Perl/CGI scripts to display and count visitors to his online resume, processing HTML document templates. Lerdorf called the set Personal Home Page. Soon, the functionality and speed of Perl, a script interpreter, was no longer enough, and Lerdorff wrote a new PHP/FI template interpreter (Personal Home Page / Forms Interpreter) in C. PHP/FI included the basic functionality of today's PHP The newborn language differed from its progenitor in that it had a simpler and more limited syntax.

    In 1997, after long beta testing, the second version of the processor, written in C, PHP/FI 2.0, was released. It was used by about 1% (approximately 50 thousand) of all Internet domains in the world.

    PHP 3.0 was the first version that resembled PHP as we know it today. In 1997, two Israeli programmers, Andy Gutmans and Ziv Sourasky, rewrote the code from scratch: the developers found PHP/FI 2.0 unsuitable for developing an e-commerce application they were working on for a University project.

    One of strengths PHP 3.0 had the ability to extend it. PHP 3.0's extensibility capabilities encouraged developers to ship new extension modules. Perhaps this was the secret to the overwhelming success of PHP 3.0.

    Another key feature PHP 3.0 introduced support for object-oriented syntax and a much more powerful and cohesive language syntax.

    The modest name “Personal Home Page” no longer really corresponded to reality and the language was called PHP: Hypertext Preprocessor (recursive: P HP: H hypertext P reprocessor).

    By the end of 1998, PHP was used by tens of thousands of users. At that time, PHP 3.0 was installed on approximately 10% of the Internet's web servers.

    PHP 3.0 was officially released in June 1998 after 9 months of public testing.

    By the winter of 1998, almost immediately after the official PHP output 3.0, Andy Gutmans and Ziv Suraski began reworking the PHP core. The objectives included increasing the performance of complex applications and improving the modularity of the PHP code base.

    The new engine, called Zend Engine (after the names of the creators, Ziv and Andy, also founders of Zend Technologies), successfully coped with the tasks and was first introduced in mid-1999. PHP 4.0, based on this engine and bringing with it a set additional functions, officially released in May 2000, almost two years after the release of its predecessor PHP 3.0. In addition to performance improvements, PHP 4.0 had several other key innovations, such as session support, output buffering, more secure ways to handle user input, and several new language constructs.

    Fifth PHP version was released by the developers on July 13, 2004. The changes include an update to the Zend core (Zend Engine 2), which significantly increases the efficiency of the interpreter. Language support introduced XML markup. The OOP functions have been completely redesigned to be very similar to the model used in Java

    The innovations, however, were made with the expectation of maintaining the greatest compatibility with code in previous versions of the language. On this moment the most stable and frequently used are versions 5.xx

    The sixth version of PHP has been under development since October 2006. It has already made many innovations and paid a lot of attention to Unicode support.

    Official site PHP: www.php.net. There you can download latest version PHP, help... By the way, PHP help is very easy to use and replaces many books and paper reference books.

    Installing PHP under Windows OS

    Note: In this article we are looking at PHP installation in Windows XP OS. Installation under OS Windows Vista similar. By the time you install PHP, you should already have the Apache web server installed and configured (see the article "Installing the Apache web server").

    1. You can choose from the following options: Windows Installer and Manual Installation (zip package). The first implies the use of an installer program, the second, accordingly, means self-installation. They also differ in the completeness of their functionality.

    By downloading the installer, you can use it to install the CGI version of PHP, and also automatically configure servers such as Microsoft IIS, Microsoft PWS and Xitami to work with this package. Using this method in conjunction with Apache is inappropriate. Automatic setup Apache is not supported by the program, so you will still have to configure the server manually. In addition, this solution has some other limitations.

    Let's use our own manual installation PHP using zip package. Moreover, this is not as difficult as it might seem at first glance.

    So, download the zip archive for Windows from the page http://www.php.net/downloads.php. In our example, this is php-5.2.5-Win32.zip.

    2. Unpack the distribution into a folder of your choice. For simplicity, you can go directly to the folder c:\php5, but you can go to any other one. For this purpose we select the folder C:\MyServers\usr\local\php5.

    3. Go to the folder with PHP. Next you need to find the file php.ini-dist, which is located in this folder and rename it to php.ini. This is a settings file.

    In order for Windows to detect this file, it is sometimes advised to simply copy it to the system Windows directory. But you shouldn’t litter the system directories, and it’s better to store the settings with the PHP itself nearby.

    3.1 In order for the php.ini file to be found, you must either
    a) specify the PHPIniDir directive for Apache, or
    b) create environment variable PHPRC
    Control Panel - System - System Properties - Advanced - Environment Variables

    and specify the HKEY_LOCAL_MACHINE\SOFTWARE\PHP\5\IniFilePath key in the Windows registry equal to C:\MyServers\usr\local\php5.
    To do this, you can use the regedit program or simply create and run the php.reg file

    Windows Registry Editor Version 5.00


    "IniFilePath"="C:\\MyServers\\usr\\local\\php5"

    3.2 In order for the system to find the necessary libraries, add the following paths to the PATH system variable: C:\MyServers\usr\local\php5\;C:\MyServers\usr\local\php5\ext\;

    Control Panel - System - System Properties - Advanced - Environment Variables - System Variables - Path (and change button)...

    Note: These steps are the same for both Windows XP and Windows Vista. But administrator rights are required.

    4. If you plan to use your server to debug scripts, we recommend that you fix error_reporting to display all errors = E_ALL.
    Those. error_reporting = E_ALL
    This directive specifies how detailed the output of warnings and error messages should be. To debug scripts, let all messages be printed.

    5. Find include_path (it is hidden in the comment), remove the comment mark and make changes:
    include_path = "C:\MyServers\usr\local\php5\PEAR"
    PEAR is a collection of various libraries written in PHP. Some of these libraries are included in the distribution.

    6. Correct extension_dir from extension_dir = "./" to extension_dir = C:/MyServers/usr/local/php5/ext
    This is one of the most important directives; without it, PHP extensions simply will not connect.

    7. Now let's connect the extensions that we need for work. Do not connect all extensions in a row! Use only those that are really needed. Find the list of extensions and remove the comments for:
    extension=php_gd2.dll
    extension=php_mysql.dll

    We connect extensions for working with images and the MySQL DBMS.

    8. Save the php.ini file. Run the php.exe file. If you see an empty console with no error messages, then everything is fine.

    9. For web server Apache PHP can work in two versions: as a module and as a CGI program. It's easier to install PHP as a CGI program, but it will run every time you access the scripts. When PHP runs as a module, its code is part of the server and is executed as a single whole. This approach provides best performance. Also in this case some are available useful features servers from PHP programs (scripts).

    Let's consider installing PHP as a module. To do this, we need to go back and remember the material from the article about installing the Apache web server. This stage is somewhat simpler and boils down to simple addition several new lines to the httpd.conf file. Go to C:\MyServers\usr\local\Apache2.2\conf and find this file.

    Add the following line to the end of the LoadModule section:
    LoadModule php5_module "C:/MyServers/usr/local/php5/php5apache2_2.dll"

    Add this line inside the conditional brace

    Add to block line:
    AddHandler application/x-httpd-php php
    This directive associates the php file extension with a unique MIME TYPE identifier. Those. files with the .php extension will be processed by PHP.

    Let's correct the so-called index files (in order to home page the default was index.php, not index.htm):

    DirectoryIndex index.php index.htm index.html

    And add the option PHPIniDir C:\MyServers\usr\local\php5 so that our php.ini is loaded, and not the standard settings. If the line PHPIniDir "C:\MyServers\usr\local\php5" is written in httpd.conf, then php.ini is loaded from the specified path.

    Although, everything can be done easier and faster.

    Let's correct the index files (see above), but you may have already done this when setting up the server.

    Let's create the file php5_mod.conf in the directory C:\WebServers\usr\local\Apache2\conf\ (use the standard Notepad program)

    Connecting this file to httpd.conf (add this line to httpd.conf at the very end):
    Include conf/php5_mod.conf

    This completes the process of adding PHP support to our Apache server. After the server is restarted, a corresponding entry containing the PHP version number should appear in the line showing the status and version of Apache. If you receive error messages, investigate them and take appropriate action. Carefully check the presence and location of all required files and directories, as well as the correctness of the specified paths - the error most likely was made there. In any case, guided by elementary logic and common sense, you can fix the overwhelming number of problems that have arisen, but let's hope that they will not exist.

    10. Let's test PHP work. Let's make sure that we did everything correctly and our scripts work. In the C:\MyServers\home\localhost\www folder, create a file test.php.

    is a standard PHP function. Using phpinfo() allows you to get a nice page containing detailed information about both PHP itself and the system as a whole, as well as about your Apache server. I recommend downloading the php_manual_ru.chm help from php.net and using it to get acquainted with PHP.

    Launch your browser and enter the address: http://localhost/test.php. If you see this page, everything is fine. Check again where the php.ini file is loaded from (there should be a line Loaded Configuration File C:\MyServers\usr\local\php5\php.ini)

    Now our Apache server has the opportunity to work with web programming languages, which are among the most common and popular today.

    From now on you can create your own scripts using PHP. Additionally, you can also install a DBMS (for example MySQL), with which your scripts could interact when solving certain problems. This step will be discussed in later.

    P.S. You can also use a regular Windows notepad to create scripts, but this is not very convenient. I recommend using the PHP Expert Editor. PHP Expert Editor is an easy-to-use PHP editor designed specifically for PHP masters. Registration for residents of the former CIS is free.

    Installing a web server on Linux:

    • If you have Ubuntu, then the article “How to install Apache web server with PHP 7, MariaDB/MySQL and phpMyAdmin (LAMP) on Ubuntu 16.10” is suitable for you.
    • If you have Arch Linux, then the article "Installing LAMP (Linux, Apache, MySQL/MariaDB, PHP7 and phpMyAdmin) on Arch Linux / BlackArch" is suitable for you.

    Local server is a very useful tool. It will definitely be useful for webmasters, PHP programmers, and penetration testers. All programs included in a typical web server installation are free and open source. A local web server consumes minimal resources and is actually not difficult to install and configure.

    This instruction will tell you how to install a local web server without using ready-made assemblies. This method has its advantages. The most important of them are: complete control over what you install; ability to use the latest versions of 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 special instructions have 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 let this bother you - the procedure is identical everywhere. I will download the latest (most recent) versions of the programs at the time of writing. If by the time you read, new versions will be released, 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(directly web server)
    • PHP– environment for running PHP programs (required by almost all websites)
    • MySQL– database management system (required by most websites)
    • phpMyAdmin– a very convenient tool for database management

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

    If you have a 64-bit version of Windows, then you can choose both 64-bit and 32-bit versions of components. The main rule is that all components must be of the same bit size. If you have a 32-bit version of Windows, then all components must be 32-bit. This does not apply to phpMyAdmin, which is written in PHP. For PHP programs, the concept of bit depth 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 this same page, but I recommend downloading the ZIP archive. On the download page we are asked to register or log in to an existing account - but this is not necessary. Just click on the link " No thanks, just start my download" Pay attention to the bit depth.

    We also need the C++ Redistributable Visual Studio 2017 file, i.e. Visual C++ redistributable component for Visual Studio 2017 (or any other later), you can download it on the official Microsoft website using the link (direct link to download the 64-bit version; direct link to download the 32-bit version). This file is needed for the web server. And MySQL requires Visual C++ Redistributable Packages for Visual Studio 2015. It can be downloaded from .

    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
    • vcredist_x64.exe

    Install files vc_redist.x64.exe And vcredist_x64.exe.

    2. Create a web server structure

    Let's create the directory structure of our server. The main idea is to separate executable files and website 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 D.B.(for databases) and htdocs(for websites).

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

    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

    Save and close the file. That's it, Apache setup is complete! A description of each changed directive can be found on this page.

    Open the command line (this can be done by pressing the Win+X keys simultaneously). Select Windows PowerShell (Administrator) there and copy there:

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

    If a request is received from the firewall for Apache, click Allow.

    Now 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 empty. If everything is done correctly, then everything should look like this:

    7. Server use 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, accordingly, will be available at http://localhost/test/ajax.php, etc.

    To create a complete 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 significantly speeded up. It is advisable to backup 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 setup

    PHP is now a very powerful, flexible, user-friendly tool. On a local computer, you can use it to solve a variety of tasks that are not necessarily related to generating Web pages. When solving extraordinary problems, you may run into 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 the maximum amount of memory that a script can use

    Post_max_size = 8M

    sets the maximum amount of data that will be accepted when sending using 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 a file uploaded to the server. The size is initially set to a very small size - only two megabytes. For example, when loading a database into phpMyAdmin, you will not be able to upload a file larger than 2 megabytes until this setting item is changed.

    Max_file_uploads = 20

    maximum number of files to upload at one time

    Max_execution_time = 30

    maximum execution time for one script

    Changing these settings is completely optional, but it is useful to know about them.

    9. Additional settings for phpMyAdmin

    We have already configured phpMyAdmin and for most people the basic functionality is enough. However, on the phpMyAdmin start page there is a message: “Additional features of phpMyAdmin are not fully configured, some functions have been disabled.”

    New features are:

    • showing relationships between (related) 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 diagram (starting from version 2.3.0 you can create PDF pages in phpMyAdmin 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 the "print preview". Since version 2.5.0, comments are used on the tables' own pages and in the mode view, appearing 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 (starting from version 2.5.0 you can save your history of all SQL queries that were made through the phpMyAdmin interface);
    • designer (starting from 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 (starting from version 3.3.x, a tracking mechanism is available. It helps you track every SQL command that was executed by phpMyAdmin. Recording of data manipulation and command recording is supported. Once enabled, you will be able to version tables);
    • user settings (starting from version 3.4.x, phpMyAdmin allows users to set most settings and save them in the database);
    • custom menus (starting from version 4.1.0 you can create user groups that will only have access to assigned menu items. A user can be assigned to a group and will only see menu items available to their group);
    • hide/show navigation items (starting from version 4.1.0 you can hide/show items in the navigation tree).
    • and others

    Now we will fully configure these additional features. Go to the link http://localhost/phpmyadmin/chk_rel.php and click "Create database". After this, all new features will be activated.

    A few screenshots of the new features:

    1) Designer

    2) Tracking

    10. Installation of a mail plug

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

    #!/usr/bin/env php

    Open the PHP configuration 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, by the program Thunderbird. Or a regular text editor.

    11. Adding a 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, every time the server starts, the following appears in the logs:

    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\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_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 whatever it's 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»:

    Move the entry to the top:

    Close all windows and save your changes.

    Restart the server.

    12. Freeze, slow traffic and/or server error Asynchronous AcceptEx failed

    If your server freezes even without load - it does not show web pages until restarted, and in the server logs there are errors Asynchronous AcceptEx failed:

    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 configuration file:

    AcceptFilter http none AcceptFilter https none EnableSendfile off EnableMMAP off

    13. Configuring cURL in the 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 exchange data with remote servers using a very large number of protocols. cURL can use cookies and supports authentication. If a web application requires cURL, then this must be specified in the dependencies. Many popular applications do not require cURL, for example phpMyAdmin and WordPress do not need to configure cURL.

    If cURL is not configured correctly, 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

    To make cURL work in Apache on Windows you need:

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

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

    This is usually not required, but you can make a backup copy of the server binary (executable) files if you wish. All these files are located 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 official websites and configure again at any time.

    If you want to make a backup copy of them (for example, before upgrading 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, i.e. folder C:\Server\– in this case, you will simultaneously get a backup copy of both executable files and data (databases, websites).

    When the copying is complete, start the services again:

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

    15. Server update

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

    Deleting a server

    If you no longer need the server, or you want to install it again, stop the services and remove them from autostart by sequentially executing on 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

    Delete the server files; to do this, delete the folder C:\Server\. Warning, this will delete all databases and your sites.

    How to protect your Apache web server from hacking on Windows

    With PHP (with choice of versions), with MySQL and phpMyAdmin. This site is hosted exactly on it: responsive and qualified technical support, installation of WordPress and other web applications in one click, as a gift when paying for a year, free site transfer. When ordering hosting + 1 month free (promotional code b33e0e2f).

    Solution acidity (pH) in hydroponics

    Perhaps one of the most overlooked aspects of gardening, pH is very important in both hydroponic, organic, and conventional soil gardening. pH is measured on a scale from 1 to 14, with a pH value of 7 considered neutral. Acids have values ​​below 7, and alkalis (bases) have values ​​above.

    This article describes the pH of hydroponic gardening and nutrient availability at different pH levels in a hydroponic substrate. Organic and soil gardening have different levels so the following diagram does not apply to them.

    Technically, the term pH refers to the potential hydrogen, a hydroxyl ion, contained in a solution. Solutions are ionized into positive and negative ions. If a solution has more hydrogen (positive) ions than hydroxyl (negative) ions, then it is an acid (1–6.9 on the pH scale). Conversely, if a solution has more hydroxyl ions than hydrogen ions, the solution is an alkali (or base), with a range of 7.1–14 on the pH scale.

    Pure water has a balance of hydrogen (H+) and hydroxyl (O-) ions and – therefore has a neutral pH (pH 7). When water is less pure, it may have a pH either higher or lower than 7.

    The pH scale is logarithmic, meaning that each unit of change equals a tenfold change in the concentration of hydrogen/hydroxyl ions. In other words, a solution with pH 6 is ten times more acidic than a solution with pH 7, and a solution with pH 5 will be ten times more acidic than a solution with pH 6 and a hundred times more acidic than a solution with pH 7. This is means that when you are adjusting the pH of your nutrient solution and you need to change the pH by two points (for example from 7.5 to 5.5) you must use ten times more pH corrector than if you only changed the pH by one point (from 7.5 to 6.5 ).

    Why pH is important

    When the pH is not at the proper level, the plant will begin to lose its ability to absorb some of the essential elements needed for healthy growth. All plants have a specific pH level that produces optimal results (see chart 1 below). This pH level varies from plant to plant, but in general most plants prefer a slightly acidic growing environment (between 6.0–6.5), although most plants can still survive in an environment with a pH between 5.0 and 7.5.

    When the pH rises above 6.5, some of the nutrients and trace elements begin to precipitate out of solution and settle on the walls of the tank and plant tray. For example: Iron may be half precipitated at pH 7.3 and at pH 8 there will be virtually no iron left in the solution. For your plants to use nutrients, they must be dissolved in solution.

    Once nutrients have precipitated out of solution, your plants will no longer be able to absorb them and will suffer (or die). Some substances also leave solution when the pH decreases. Chart 2 (below) will show you what happens to the availability of certain nutrients at different pH levels.

    NOTE!!!:
    This chart is for hydroponic gardening only and is not suitable for organic or soil gardening.

    pH check

    When you're growing hydroponically, checking and adjusting your pH is simple, but these procedures can be a little complicated when growing organically or in the ground. There are several ways to test the pH of the nutrient solution in your hydroponic system.

    Paper test strips is probably the most inexpensive way to test the pH of a nutrient solution. These strips are impregnated with a pH-sensitive dye that changes color when the paper strip is dipped into a nutrient solution. Then compare the color of the paper strip with a color chart to determine the pH of the solution being tested. These test strips are inexpensive, but can sometimes be “hard to read” because the color differences can be subtle.

    Liquid pH test kits is probably the most popular way for the amateur gardener to test pH. These liquid test kits work by adding a few drops of a pH-sensitive dye to a small amount of nutrient solution, and then comparing the color of the final liquid to a color chart. Liquid tests are a little more expensive than paper test strips, but they work very well and are usually easier to “read” than paper test strips.

    Most high-tech ways to test pH are: digital measuring instruments. These meters are available in a huge variety of sizes and prices. The most popular type of digital pH meter for hobby gardening is digital pens. These pens are made by several different companies and are very comfortable and easy to use. You simply dip the electrode into the nutrient solution for a while and the pH value is displayed on the LCD display.

    pH meters are very fast and accurate (when properly calibrated). They need proper care, otherwise they will stop working. The glass electrode bulb must be kept clean and moist at all times. pH meters are very sensitive voltmeters and are susceptible to problems with the electrode.

    pH meters are slightly sensitive to temperature changes. Many of the pH meters sold on the market have Automatic Temperature Compensation (ATC), which corrects the pH meter reading relative to temperature. On pH meters without temperature compensation, pH should be measured at the same time of day to minimize any temperature-related fluctuations.

    pH meters usually need to be calibrated frequently because the meter can drift and to ensure accuracy, you should check the calibration frequently. The tip should be stored in electrode storage solution or buffer solution. Never allow the tip to dry out.

    Because pH meters have a reputation for breaking for no reason, it's a good idea to have emergency pH testing backup (paper strips or liquid pH test kits) just in case.

    pH adjustment

    There are several chemicals used by home gardeners to adjust pH. Probably the most popular are phosphoric acid (to lower pH) and potassium hydroxide (to raise pH). Both of these chemicals are relatively safe, although they can cause burns and should never come into contact with the eyes.

    More often, hydroponics stores sell pH adjusters that are diluted to a level that is reasonably safe and convenient. Concentrated regulators can cause large changes in pH, and can make pH adjustment very frustrating.

    Several other chemicals can be used to adjust the pH of hydroponic nutrient solutions. Nitric and sulfuric acids can be used to lower pH, but they are much more dangerous than phosphoric acid. Food grade citric acid is sometimes used in organic gardening to lower pH.

    Always add nutrients to the water before testing and adjusting the pH of your nutrient solution. Nutrients typically lower the pH of water due to chemical compensation. After adding nutrients and mixing the solution, check the pH using available measuring instruments.

    If the pH needs to be adjusted, add an appropriate regulator. Use small amounts of pH adjuster until you become comfortable with the process. Recheck the pH and repeat the above steps until the pH level reaches the desired value.

    The pH of the nutrient solution will tend to rise as the plants use the nutrients. As a result, the pH must be checked periodically (and adjusted if necessary). To start, I suggest that you check the pH daily. Each system changes the pH in different proportions depending on a variety of factors: the type of substrate used, weather, plant species and age; everything is affected by pH changes.





    

    2024 gtavrl.ru.