Home Backend Development PHP Tutorial Installation and configuration method of Windows Apache2.2.11 and Php5.2.9-1_PHP tutorial

Installation and configuration method of Windows Apache2.2.11 and Php5.2.9-1_PHP tutorial

Jul 21, 2016 pm 03:46 PM
windows and Install method use of Configuration

Because pharmar uses Mcafee’s anti-virus software, all programs are required to be installed in Program Files, so these files are placed under D:Program Files for easy management. Mcafee is easy to use when writing protection rules.
Apache installation and configuration

Open apache official website http://archive.apache.org/dist/httpd/binaries/win32/ or mirror website http://apache.mirror.phpchina.com /httpd/binaries/win32/, download the apache_2.2.11-win32-x86-no_ssl.msi installation file inside. Among them, there are two types of the same version: no_ssl and openssl. Openssl has an additional SSL security authentication mode. Its protocol is HTTPS instead of HTTP. This is the difference between a server with SSL and a general web server. Under normal circumstances, it will be ok if we download the no_ssl version.

After downloading the apache installation file, click Install. After three consecutive times of next, you will enter the server information configuration interface, which requires you to enter the network domain, server domain and website administrator’s email address. Ordinary users can follow Just fill in the format. After pressing Next again, an interface for selecting the installation path appears. The default path is relatively long. Pharmar changes the installation path to: "D:Program FilesApache" and continues the installation until it is completed.

After the installation is completed, apache will start automatically. You can test whether apache starts successfully. Enter: http://localhost/ or http://127.0.0.1/ in the browser address bar. If "It works." appears, congratulations, apache has been successfully installed; at the same time, click on the taskbar in the lower right corner of the computer. There is a green apache server running icon.

Apache also has a configuration file: httpd:conf that needs to be configured in order for php to run. The location is: D:Program FilesApacheconf directory. Open httpd:conf:
1), search for "DocumentRoot", this is the directory where the specified homepage is placed. The default is: "D:Program FilesApachehtdocs". You can use the default directory or define one yourself, such as: "D:/PHP". Note: Do not add "/" at the end of the directory.
2) Search for "DirectoryIndex", which is the default home page file name. You can add index.php, etc. after index.html. Leave a space between each type.
3), find

Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all

Modify to:

Options FollowSymLinks
AllowOverride None
Order deny,allow
allow from all

If you don’t change this If so, an error message like You don't have permission to access / on this server. may appear, especially after changing the path of the default homepage.

Note: Every time you modify the httpd:conf file, you must restart the apache server. In addition, if your win32 system is also running an iis server, you must first stop the iis server and then start apache, otherwise the apache server cannot start.

How to install and configure Php

First download the windows version from the official website of php http://www.php.net/downloads.php. There are two Versions: PHP 5.2.9 zip package and PHP 5.2.9 installer. The latest version is 5.3.0. Pharmar uses version 5.2.9. PHP 5.2.9 installer is an automatic installation method. Although it is relatively automated, it is limited in many aspects. Therefore, pharmar does not recommend this method. The following describes the manual installation of PHP 5.2.9 zip package.

1) Unzip the PHP compressed package zip to a directory. Recommended: "C:/PHP", the pharmar is D:Program FilesPhp.
2) Rename the php.ini-dist file in the PHP directory (D:Program FilesPhp) to php.ini. This is the configuration file of PHP. Modify the following places. After modification, change php.ini Copy the file to the C: WINDOWS directory:
extension_dir="D:Program FilesPhpext", pointing to the path where the "php_*.dll" file is placed in the php folder. The paths for PHP4 and PHP5 are different here.
doc_root="D:PHP", points to the homepage location set by apache previously;
default_charset="gb2312", modifies the default character set. Here, if there is a semicolon ";" in front of it, remove the semicolon;
register_globals=Off changed to register_globals=On to make passing global variables valid;
extension=php_dba.dll If there is a semicolon in front, cancel the semicolon, the same as below;
extension=php_dbase.dll
extension =php_gd2.dll GD library for drawing, generally used for graphical verification codes;
extension=php_mysql.dll is used to connect to MYSQL database;
3) Copy the php5ts.dll file in the PHP directory to C:WINDOWSsystem32 Table of contents.
4), finally modify Apache’s httpd.conf file. Add the following 2 lines at the end of the file to install PHP into Apache in module mode:
LoadModule php5_module D:/Program Files/Php/php5apache2_2.dll
AddType application/x-httpd-php .php

Note: The directory path in the first line must be updated to the current version of the apache dynamic link library. For example, here I am using the apache2.2.11 version and php5.2.9, then this file must be php5apache2_2.dll, not php5apache2_2.dll. php5apache.dll, php5apache2.dll, etc. The second line is the suffix of the php script.
In the php4 version, you need to add a line AddType mod_php4.c, but in php5, there is no need for such a line AddType mod_php5.c. php5 has been integrated, otherwise apache cannot start.

The above completes the configuration process of apache and php, restart apache. Create a new file index.php in the server's default directory "D:Program FilesApachehtdocs" and write the following code:
phpinfo();
?>
In the browser address Enter http://127.0.0.1/ or http://localhost/ in the column, and you will see the php version information. So far, php and apache have been successfully installed.

Here is a detail: the directory delimiter in Apache's configuration file httpd.conf is "/", while the directory in PHP's configuration file php.ini requires a backslash " ", don't do it Mixed up.

The installation of MYSQL is simple. Go to the official website http://dev.mysql.com/downloads/mysql/5.0.html, download mysql under the windows platform, select Windows ZIP/Setup.EXE (x86), the latest version is 5.0.77, and download it. Install directly. After the installation is completed, you can enter the configuration wizard and set the mysql database password. Everything is OK.
For the installation and configuration of mysql, please see: phpMyAdmin installation configuration method and problem solving

Errors encountered during the pharmar installation process:
Apache appears after installing PHP under Windows The main reason for the error LoadModule takes two arguments is this sentence in httpd.conf:
LoadModule php5_module D:Program FilesPHPphp5apache2_2.dll
The interpreter treats the spaces in Program Files as the separator of the two parameters. Therefore, spaces cannot appear in the statement.I searched online for a long time and couldn't find a solution. Finally, I solved the problem by using the first-level directory symbol and changed it to the following:
LoadModule php5_module ../php/php5apache2_2.dll
Because apache is installed in the D:Program FilesApache directory Next, PHP is installed in D:Program Filesphp, so ../ means the D:Program Files directory. This is finally solved. I hope everyone will use their brains during the installation and configuration process to find a way.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/320246.htmlTechArticleBecause pharmar uses Mcafee’s anti-virus software, all programs are required to be installed in Program Files, so these files are Place it under D:Program Files for easy management. Mcafee is good when writing protection rules...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1665
14
PHP Tutorial
1270
29
C# Tutorial
1250
24
Can vs code run in Windows 8 Can vs code run in Windows 8 Apr 15, 2025 pm 07:24 PM

VS Code can run on Windows 8, but the experience may not be great. First make sure the system has been updated to the latest patch, then download the VS Code installation package that matches the system architecture and install it as prompted. After installation, be aware that some extensions may be incompatible with Windows 8 and need to look for alternative extensions or use newer Windows systems in a virtual machine. Install the necessary extensions to check whether they work properly. Although VS Code is feasible on Windows 8, it is recommended to upgrade to a newer Windows system for a better development experience and security.

Which operating systems are supported by Tigervnc in Debian Which operating systems are supported by Tigervnc in Debian Apr 12, 2025 pm 10:15 PM

The open source VNC tool Tigervnc is compatible with a wide range of operating systems, including Windows, Linux, and macOS. This article will introduce in detail the application of Tigervnc on the Debian system. Tigervnc is integrated in the application system of Debian system: In the Debian system, Tigervnc is integrated into the system as a VNC server component. Users can start VNC services through command line tools such as vncserver and customize display settings such as resolution and color depth. Cross-platform connection: Tigervnc client supports Windows, Linux, and macOS, which means users can run this from any

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! Apr 17, 2025 pm 09:54 PM

In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

Recommended system maintenance and optimization tools in Mac system Recommended system maintenance and optimization tools in Mac system Apr 12, 2025 pm 04:45 PM

Mac system maintenance includes: disk management (use OmniDiskSweeper to clean disk space, use disk tools to check disk errors) memory management (use Activity Monitor to monitor memory usage, end over-occupying processes) startup item management (use Linc or LaunchControl to manage startup items, disable unnecessary startup items) system cache cleaning (use CleanMyMac X or manually clean system cache) software update (timely update system and applications) regular backup (use Time Machine to backup data regularly) good usage habits (not installing applications excessively, cleaning files regularly, and monitoring system logs)

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

vscode cannot install extension vscode cannot install extension Apr 15, 2025 pm 07:18 PM

The reasons for the installation of VS Code extensions may be: network instability, insufficient permissions, system compatibility issues, VS Code version is too old, antivirus software or firewall interference. By checking network connections, permissions, log files, updating VS Code, disabling security software, and restarting VS Code or computers, you can gradually troubleshoot and resolve issues.

See all articles