Configure php and cgi server with ApacheServer_PHP tutorial
Author: coolfire Nowadays, more and more personal homepage webmasters need to know how to configure their own PHP and CGI servers under Windows systems to facilitate local debugging of CGI and PHP programs. We can use Apache (windows version) to do it all at once: The following articles are compiled by myself about the installation and configuration of Apache Server in a stand-alone Windows environment. If you are testing your website in a Windows stand-alone environment, it is recommended that you refer to it. Mainly includes: installing and configuring Apache Server; using Perl CGI scripts; using PHP scripts. --Refer to "Apache Server System Administrator's Manual" for some content. 1. Installation under Windows Of course, you must first have the Apache installation program. You might as well go to http://www.apache.org/dist to have a look. Here is a list of Apache mirror sites worldwide to find the one closest to you. If you are in China, I suggest you go to the software house to have a look. The general file name of A pache's installation program is apache_1_3_x.win32.exe. Put it into your machine and run it. The installation program will prompt you to modify the default directory location of Apache installation C:Program FilesApache GroupApache. In order to facilitate future configuration and maintenance, it is recommended that you install it in the root directory, such as C: Apache. After that, you will be prompted to select the installation type. It is recommended that you select Custom so that you will know what is installed. Specific projects include Application File, Source Code, Apache Manual, Additional Modules, Icons, and Repuired Directories. You can decide how to install it based on your situation. If all goes well (there should be no problems at this point), the installation will be completed shortly. Apache will automatically complete some basic configurations. You can use UltraEdit-32 (or other text editing software) to open the c onfhttpd.conf file to get a rough idea. 2. Configure Apache Server The first thing to do here is the basic configuration so that your Apache Server can run as you wish. Use UltraEdit-32 (or other text editing software) to open the confhttpd.conf file. 1. Find ServerName. Define your domain name here. In this way, when Apache Server is running, you can access your site in the browser. If there is a # in front of it, remember to delete it. This is the comment mark of conf. 2. Find ServerAdmin. Enter your email address here. If you only use it on a single computer, it doesn't matter whether you change it or not. 3. Find. There is a sentence Options at the bottom, remove all the following parameters, and add an All (note that it is case-sensitive! The same below.); then there is a sentence Allow Override, also remove all the following parameters, and add an All. 4. Find DocumentRoot. This statement specifies the path of your website, which is the directory where your homepage is placed. You can use the default one, or you can specify one yourself, but remember, do not put "/" at the end of this sentence. Also note that the "" of the directory is written as "/" in Apache Server. 5. Find the DirectoryIndex. This is The first displayed homepage of your site. After changing these, you can start Apache Server. If not, follow the above steps to modify it carefully. 3. Add support for Perl CGI scripts. To enable your Apache Server to support CGI scripts, you must first install Perl for Win32. The installation process is not described in detail. It is assumed that Perl is installed in the C:Perl directory. 1. Find the ScriptAlias file. /cgi-bin/ "C:/Apache/cgi-bin/". Delete the # in front and point the path in "" to the directory where you store the CGI script. That is, the CGI script in this directory can be executed. 2. , find it. Point the path in "" to the directory where you store the CGI script. Change the parameters of Options and Allow Override to All. 3. Find AddHandler cgi-script.cgi and delete it. Add .pl at the end. Note: The Perl interpretation path in the CGI script is changed to: #!C:perl inperl. Otherwise, a 500 error will occur. 4. Add support for PHP scripts. You also need to install PHP here. Windows version. Assume it is installed in the C:php directory. Add: ScriptAlias /php/ "c:/php/" to the httpd.conf file. AddType application/x-httpd-php3 .php3 .php .phtml Action application/x -httpd-php3 "/php/php.exe" Your PHP script can be placed anywhere on the site (except cgi-bin). At this point, your Apache Server can support both CGI and PHP. That's good. Go ahead. Good luck!

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

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

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

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

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

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

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

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.

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.
