PHP installation. Installing PHP on your local computer


In this article we will look at installing and configuring a Web server Apache, PHP 5 And MySQL DBMS to use them on a local machine under the operating system 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. Mirrors usually have many different 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 it is, compiled for the architecture (x86) for Windows (win32) without SSL support (no_ssl) Apache server(apache) version 2.0.50 - 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 most latest version, since 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. The order in which Apache, PHP and MySQL are installed does not 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: server domain name, 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 running on different platforms and operating systems around the world. 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. UNIX and Windows operating systems 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 feature 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 the 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 it slightly improves performance, since PHP module 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 Apache httpd.conf configuration file for editing 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 installed PHP.

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 transferred via 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 reboot the Apache server, and create a test one in the root directory of the virtual host ("C:/www/scripts") PHP file(index.php):

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 setting up MySQL. 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 databases MySQL data.

Open the php.ini file for editing from Windows directory. 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 must point to the directory where they are stored. PHP extensions. 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 versions of MySQL (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

If the PHP connection is not configured, when accessing files with the 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 the existence of the following 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 with MySQL installation. 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 of the php_mysql.dll file (exactly for the version of PHP that is installed on the system)?
The versions of the php_mysql.dll file differ for different PHP versions, 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 about installing the Apache+PHP+MySQL combination on our forum dedicated to installation and setting up Apache, PHP and extension libraries.

    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 mandatory elements necessary 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.

    Last update: 12/16/2017

    There are different ways to install everything you need 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. As operating system Windows will be used.

    What does installing PHP involve? First, we need a 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 MySQL databases, 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.


    Direct link: php-5.3.10-Win32-VC9-x86.zip
    At the same time, immediately download the documentation in Russian in .chm format, you will need it when studying and working: php_enhanced_ru.chm

    Unpack the archive into the desired directory (initially, “C:\php” is suggested). Open the configuration file containing the recommended settings - “php.ini-development” (located in the root of the distribution), rename it php.ini and make the following changes.

    Editing php.ini:

    1. Find the line:
      post_max_size = 8M
      Increase to 16 MB maximum size received data POST method, changing it to:
      post_max_size = 16M
    2. Find the line:
      ;include_path = ".;c:\php\includes"
      Uncomment it by removing the semicolon before the line.
      (Attention exception! Backslashes when specifying path):
      include_path = ".;c:\php\includes"
      Create an empty directory "C:\php\includes" to store the included classes.
    3. Find the line:
      extension_dir = "./"
      Set the value of this directive to the path to the folder with extensions:
      extension_dir = "C:/php/ext"
    4. Find the line:
      ;upload_tmp_dir =
      Uncomment it and specify the following path in the value:
      upload_tmp_dir = "C:/php/upload"
      Create an empty folder “C:\php\upload” to store temporary files uploaded via HTTP.
    5. Find the line:
      upload_max_filesize = 2M
      Increase the maximum allowed file upload size to 16 MB:
      upload_max_filesize = 16M
    6. Connect, uncommenting, the extension library data:
      extension=php_bz2.dll
      extension=php_curl.dll
      extension=php_gd2.dll
      extension=php_mbstring.dll
      extension=php_mysql.dll
      extension=php_mysqli.dll
    7. Find the line:
      ;date.timezone=
      Uncomment and set the value to the time zone of your location (a list of time zones can be found in the documentation):
      date.timezone = "Europe/Moscow"
    8. Find the line:
      ;session.save_path = "/tmp"
      Uncomment and set the value of this directive to the following path:
      session.save_path = "C:/php/tmp"
      Create an empty folder “C:\php\tmp” to store temporary session files.

    Save your changes and close the php.ini file.

    Next, you need to add the directory with the installed PHP interpreter to the PATH of the operating system. To do this, follow the path “Start” -> “ Control Panel» (“Control Panel”) -> “System”, open the “Advanced” tab, click the “Environment Variables” button (“ Environment Variables"), in the "System Variables" section, make double click on the “Path” line, add in the “Variable Value” field, to what already exists there, the path to the directory with PHP installed, for example, “C:\php” (without quotes). Note that the semicolon character separates the paths. For the changes to take effect, restart your operating system.

    Example Path string:
    %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\php;C:\Program Files\MySQL\MySQL Server 5.5\bin

    Installation and configuration of the PHP interpreter is completed.

    Description of connected libraries:

    php_bz2.dll- By using of this extension PHP will be able to create and unpack archives in bzip2 format.

    php_curl.dll– A very important and necessary library that allows you to connect and work with servers using huge amount Internet protocols.

    php_gd2.dll– Another indispensable library that allows you to work with graphics. You thought PHP was only possible HTML pages generate? But no! WITH using PHP You can do almost anything, including drawing.

    php_mbstring.dll– The library contains functions for working with multi-byte encodings, which include the encodings of eastern languages ​​(Japanese, Chinese, Korean), Unicode (UTF-8) and others.

    php_mysql.dll– The name of the library speaks for itself - it is necessary to work with the MySQL server.

    php_mysqli.dllThis library is an extension of the previous one and contains additional functions PHP for working with the server MySQL versions 4.1.3 and higher.

    These libraries should be enough for a complete PHP work. Over time, if the need arises, you will be able to connect additional libraries, but you should not connect them all at once with the thought that you won’t spoil the porridge with butter; in this case, an excessive number of connected libraries can noticeably slow down PHP.

    Original article: http://php-myadmin.ru/learning/instrument-php.html





    

    2024 gtavrl.ru.