Home >Backend Development >PHP Tutorial >Installation of PHP and its modules_PHP tutorial
We know that the operation of ASP requires the support of PWS or IIS server. Without these two servers, it cannot run. ASP server support installation usually includes ASP
Language interpreter and WEB server.
Similarly, the installation of PHP is also divided into two parts: one is the installation of PHP and its modules, and the other is the setup of the WEB server. Installation of PHP and its modules, including installation of PHP core files,
Installation of related extension modules and PHP. Settings of various options of INI files.
If PHP is not in a WEB server, it will not play a big role, so you must install a WEB server and make the necessary configurations so that the WEB server can handle PHP scripts
This.
Now most of our operating systems are Microsoft Windows systems. Next, we will first introduce the PHP operating environment and WEB server installation under the Windows operating platform
1. Installation of PHP and its modules
The installation of PHP is relatively simple. First, we need to download the PHP compressed packages adapted to our own platform from the http://www.php.net/ site (the compressed package used in the example is php-4.1.2.tar.gz), and unzip them. Then click Install. Usually we install it to the C:PHP directory (this depends on the individual operating system drive letter).
There must be corresponding dynamic link libraries for all required plug-in modules. If the module file you installed is not included in PHP, you can go to the http://www.php.net/ website to find and download it, and then copy it to the C:PHP directory. This completes the installation.
The next step is when you need to concentrate. For those who are new to PHP and starting to learn PHP, this step is very important, because if it is not set up correctly, it will not be able to interpret any PHP script, that is to say The basic operating conditions for PHP you need have not been established.
Next we have to work with the PHP configuration file php.ini. Copy the text configuration file PHP.INI-DIST in the PHP installation directory to your Windows directory (c:windows or c:winnt). And change the file suffix name to php.ini. There is a very important issue to note here. If there are php.ini files in both the windows directory and the php directory, then the files in the php directory will take priority. That is to say, the php interpreter will convert the files in the PHP directory. As a php configuration file, the one in the windows directory will not work.
Careful friends will notice that there is also a php.ini-optimized file in the php directory. Like phin.ini-dist, it is the configuration file of the PHP interpreter. The configuration content of the two is similar, but the former Optimizations have been made in some options to reduce system memory usage. However, it is recommended that friends who are not very familiar with PHP should not use this file, because it is reserved from php3, and its use in php4 may cause some module functions to fail.
There are quite a lot of php.ini file configuration files on the Internet, but there are big misunderstandings in them. Some misunderstandings are quoted below:
How to install Apache (PWS) PHP4 MySQL phpMyAdmin under Windows 98
“
Author: Tony Reeves ()
Published date: 08/08 16:52
******************************************
1. Install PHP4
Software acquisition: foreign http://www.php.net; domestic http://www.phpchina.com, http://phpuser.com, etc. After obtaining the compressed package, unzip it to the c:php4 directory.
****************************************************** ******************
Copy php4ts.dll (***in the unzipped directory***),
and msvcrt.dll (***in the subdirectory dll in the unzipped directory***)
Go to C:windowssystem
…
"
The secret of installing PHP4 and MySQL under Windows 2000
“
Author: chenlinhaime
Published date: 2000/08/03 11:54
My php4 and mysql software packages are php-4.0.1pl2-Win32.zip, mysql-3.23.19-beta-win.zip.
…
Now start installing php4. Use winzip to unzip the software package to c:php4, then copy all the dll files in the directory to c:winntsystem32. Do not overwrite the existing dll files
;Then copy the two files php.exe and php.ini-dist in the directory to c:winnt;
Rename c:winntphp.ini-dist to php.ini, open it, find; Windows Extensions, change extension=php_calendar.dll, extension=php_zlib.dll
Remove the “;” before extension=php_ldap.dll and close the file.
…
"
PHP installation and setup process tutorial for fools:
“
…
2. Install PWS to the default directory (according to typical installation) 3. Install php4 (the name of the file I downloaded is: php-4.0b4pl1-Win32.zip and extract it) There are the following files in the PHP directory
php.ini-dist ... php4isapi.dll php_mysql.dll (1) Copy all dll files to your system directory such as C:windowssystem
(2) Rename php.ini-dist to php.ini, modify extension_dir = ./ in php.ini to extension_dir = c:windowssystem; (3) Modify
in Php.ini;extension=php_mysql.dll Remove the ";" sign in front (that is, extension=php_mysql.dll)
…
"
It’s not that their configuration methods are wrong. As the saying goes, all roads lead to Rome. You can also achieve the goal by following the methods in the article, but there are many more steps. In the above three articles, php*.dll This step of copying to windowssystem can be omitted, because after configuration, without modifying the path of "extension_dir = ./" in php.ini, the server can directly recognize the path of the php dynamic link library file, and there is no need to search for it. , so there are misunderstandings in the above configuration file. Of course, it does not mean that the configuration is wrong. After copying the corresponding files and configuring the php.ini file as they say, the server will also load the php dynamic link according to the path. library file.
Note: For more exciting tutorials, please pay attention to Bangkejia Computer Tutorials column, Bangkejia computer office group: 189034526 Welcome Your joining