


PHP installation guide: Install and configure PHP_PHP tutorial
二、安装并配置PHP:
-
I want to use Apache as my Webserver:
A little explanation: This article mainly focuses on installation and configuration The php-3_0_15-win32 version of PHP is taken as an example and explained step by step. Instructions on the installation and configuration of the php-4.0b4-Win32 version of PHP are also included.
Step 1:Unzip the php-3_0_15-win32 you downloaded, and store all its PHP files in the directory you need, for example: "D:php3".
Step 2:Rename the php3.ini-dist file under D:php3 to php3.ini. If it is the source code package of the php4.x version, the corresponding file decompressed is php.ini-dist, and we also need to rename it to php.ini. If you want to use Apache as your personal Web server, please install the php-3_0_15-win32 version of PHP. If you want to use PWS as your personal Web server, you can install either of the two.
Step 3:Open your php3.ini file with NotePad and start editing:
1. Change the comment character of the upload_tmp_dir line, that is, the preceding semicolon Remove ";" to make this line work in the php.ini document. upload_tmp_dir is used to define the temporary path where uploaded files are stored. Here you can also define an absolute path for it, for example: upload_tmp_dir = d:phptest. Of course, at this time, your d:phptest directory must have writable and executable permissions.
If you have defined the upload path in your .php3 program, the path of the uploaded file will be based on the path defined in the .php3 program.
Upload_max_filesize is used to limit the maximum size of uploaded files processed by PHP. It is calculated in bytes. The default value is 2097152= 2*1024*1024 bytes (2 megabytes). You can modify the default value to Defines the maximum upload file size.
2. Modify extension_dir = ./ to your PHP3 installation directory, for example: extension_dir = d:php3
3. What database support do you need? Find here:
; Windows Extensions
; extension=php3_mysql.dll
; extension=php3_calendar.dll
; extension=php3_dbase.dll
=php3_dbm.dll
; extension=php3_mssql.dll
; extension=php3_zlib.dll
; extension=php3_filepro.dll
🎜> ;extension=php3_crypt.dll
;extension=php3_msql2.dll
;extension=php3_odbc.dll
Then, according to your own needs, put the DLL file of the database you want to use? in front of one line The comment character, that is, the preceding semicolon ";" is removed. For example: If I need MySQL support, I just need to remove the semicolon in front of ;extension=php3_mysql.dll. If the DLL file of the database you use is not listed here, it doesn't matter, you can add it yourself.
4. If you want to use PHP to send emails, please find here:
SMTP = localhost
sendmail_from = me@localhost.com
It is best to set up an SMTP server for SMTP It is your local SMTP server. I am taking the SMTP server of 21cn as an example. Then, fill in your E-MAIL address in sendmail_from. For example, it can be changed to this:
SMTP = smtp.21cn.com
sendmail_from = pert@21cn.com
5. Set the following items in the [mysql] column as follows:
mysql.default_port = 3306
mysql.default_host = localhost
mysql.default_user = root
The mysql_connect() function is used to establish a connection with the mysql database on the specified host. The function syntax is as follows:
mysql_connect(string [hostname] [:port], string [username], string [password] ]);
Here we set the default port for connecting to the mysql database to 3306. The host to establish the connection is the local host localhost, the user is root, and the parameter password is not set. The password parameter is empty, that is There is no password. If the mysql database to be connected is located on a different port, we must add a colon and the port number after the host name, as shown below:
$db = mysql_connect(localhost:3306,root,password);
6. If the Web server you are using is Omni Httpd, please skip this step; if you are using Apache as your Web server, you can set doc_root as the root directory of the Apache server, such as this example "D:apachehtdocs" (the installation and settings of Apache are detailed in the next section); if you use PWS as your Web server, you can set the doc_root directory to point to the default directory of the PWS server. The root directory, such as "D:Inetpubwwwroot" in this example (the installation and settings of PWS are detailed in the next section). Of course, the easiest thing is that you can set nothing and still leave it blank.
7. A less important setting:
If you are using PWS as your Web Server, you can also set browscap.ini and modify; browscap = extra/browscap. ini changed to browscap = c:windowssysteminetsrv rowscap.ini.
Step 5:
At this point, php3.ini has been basically edited. You can also set other items of php3.ini according to different needs, so I won’t go into details here. What you have to do now is to copy the compiled php3.ini to your Windows system directory.
I want to use PWS as my Web server:
- 1. I installed the PHP3.X version of PHP When we use PWS as the Web server, we except In addition to compiling the php3.ini file as described above, you must also modify the system registry so that PWS can support PHP files.Because the setup steps involve modifying the system registry, and any incorrect modification to the registry may cause instability in your system, therefore, I strongly recommend that you back up your registry information first, and then make the following modifications. set up.
1. First, please run "regedit" under the start menu to enter the "Registry Editor".
2. Enter the following location in the registry: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesw3svcparametersScript Map
3. Right-click the blank space in the right window of the "Registry Editor" and select: New--$#@62;String value.
4. Enter the extension name of the PHP Script you want, for example: .php3.
5. Double-click the new string and enter: "d:php3php.exe %s %s" in the pop-up "Edit String" dialog box. Please note that "%s %s" is very important. If Without it, PHP will not execute correctly. If necessary, please change d:php3php.exe to the path of php.exe on your machine.
6. Repeat steps 3, 4, and 5 to create other PHP Script extensions, such as links to .php, phtml, etc.
7. Now let’s create an open command for PHP Script.
8. Exit Regedit and restart your computer.
2. I installed the PHP4. In addition to compiling the php3.ini file, you must also make the following modification settings.
1. Copy all the dll files in the PHP directory to your system directory, such as C:windowssystem
2. Open and modify pws-php4.reg with your favorite text editor.
Change ".php"="[PUT PATH HERE]php4isapi.dll" to ".php"="d:phpphp4isapi.dll" At the same time, add the line ".php3"="d:phpphp4isapi.dll", this This is to ensure compatibility with the original files ending with PHP3.
3. Double-click the pws-php4.reg file, select Merge, and add PHP4 to the registry.
4. OK, please restart your computer now.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

CMS stands for Content Management System. It is a software application or platform that enables users to create, manage, and modify digital content without requiring advanced technical knowledge. CMS allows users to easily create and organize content

PHP provides tools to allow websites to easily integrate social media functions: 1. Dynamically generate social media sharing buttons for users to share content; 2. Integrate with the OAuth library to achieve seamless social media login; 3. Use the HTTP library to capture social media Data, obtain user profile, posts and other information.
