PHP Modular Installation tutorial, PHP Modular Tutorial _php Tutorial

Source: Internet
Author: User
Tags php database php regular expression

PHP Modular Installation tutorial, PHP Modular Tutorial


This article describes the method of modular installation of PHP. Share to everyone for your reference, as follows:

PHP (hypertext preprocessor) Although simple but functional is a very powerful scripting language, the following is based on the WINDOWSXP+SP2 operating platform under the apache2.0.53+ php5.2.1 installation and basic configuration procedures are documented for reference:

First, download the following programs from the official website:

1. Apache_2.0.53-win32-x86-no_ssl.exe
2. Php-5.2.1-win32.zip (binary compression package)

Second, installation and configuration process:

1. Install the Apache WEB server:

Double-click the installation file Apache_2.0.53-win32-x86-no_ssl.exe install it in the D:/apache directory (I created a new Apache folder on D disk),

-------------------------------------------------------
+ Note: The following issues may occur during the installation:
+ OS 10048 is typically used only once per socket address (Protocol/network address/Port):
+ Make_sock:could not bind to address 0.0.0.0:80 ... "is typically caused by IIS taking up 80 ports
+ Two workarounds:
+ 1, open Control Panel, service find IIS admin shutdown and disable
+ 2, if you do not want to shut down the IIS service can change the port used by Apache to another port
+ Change Listen 80 in apache2/conf/httpd.conf to Listen (the port you want to use) such as Listen 8080
+ However, when you visit the Web service under your Apache, add the port number after the domain name
+ such as: http://localhost:8080
-------------------------------------------------------

To test if Apache is successfully installed, enter it in the browser: http://localhost:8080/http://localhost if you can see Apache's flag feathers, then congratulations!!!

2. Install PHP:

Extract the contents of the Php-5.2.1-win32.zip to d:/php (I created a new PHP folder in the D disk), find the PHP directory php.ini-dist renamed to PHP.ini and copied to the Windows directory. Copy the Php5ts.dll,libmysql.dll in the d:/php directory to the system directory (WINDOWS/SYSTEMS32).

Configure the httpd.conf in Apache

Open d:/apache2/conf/httpd.conf This file
Find Adddefaultcharset iso-8859-1 change it to Adddefaultcharset GB2312 (let default language encoding to Simplified Chinese)
Find DocumentRoot "D:/apache2/htdocs" to change it to your Web directory (not change) as my DocumentRoot "G:/web Project"
Find DirectoryIndex index.html Index.html.var in the back add index.htm index.php

Select installation Mode: Modular mode installation or CGI mode installation (optional)

Modular installation Configuration

Find #LoadModule Ssl_module modules/mod_ssl.so This line, add a line after this line:

LoadModule Php5_module D:/php/php5apache2.dll

Where D:/php/php5apache2.dll is in your PHP directory where Php5apache2.dll is located

Note: LoadModule php5_module D:/php/php5apache2.dll
Note: Where C:/php5/php5apache2.dll is the appropriate path for you to install PHP. Don't confuse Php5apache2.dll with Php5apache2 _2.dll.

The Php5apache2.dll is only available for Apache version 2.0.

In the case of apache2.2.* or above, the "cannot load C:/php/php5apache2.dll into Server:the specified module could is not found" may appear. Or: "The requested operation has failed"

Find AddType application/x-gzip gz. tgz line, add a line after this line

AddType application/x-httpd-php. php

CGI installation configuration

Find the AddType application/x-gzip gz tgz Line and add the following:

scriptalias/php/"d:/php/" AddType application/x-httpd-php phpaction application/x-httpd-php "/php/php-cgi.exe"

Note: The English full name of CGI is Common Gateway Interface, usually translated as a common Gateway interface, which is an interface for HTTP servers to communicate with other programs on the machine. This "other program" can be written in any computer language, which obtains input from the HTTP server through the CGI interface, and then passes the result of the operation to the HTTP server via the CGI interface, which the HTTP server sends to the browser.

The advent of CGI makes the Web from static to dynamic, as the web becomes more and more popular, many sites need to have dynamic pages, in order to cross with the browser. The shortcomings of the CGI approach are also becoming more prominent. Because HTTP is generating a dynamic page, the system must start a new process to run the CGI program, and the fork is a time-consuming and resource-intensive task. That's where the fastcgi comes in.

FastCGI is like a resident (long-live) CGI, which can be executed all the time, so long as it is activated, it will not take a moment to fork once (this is the most notorious fork-and-execute mode of CGI).

At this point the PHP environment is basically configured successfully

Build a file named test.php in the Web root directory (such as my d:/website) as follows

Restart Apache Service

Open http://localhost/test.php in a browser or on a Linux system:/usr/local/php/bin/php-f test.php

If you can see the PHP configuration output information is OK

Note: Modular Installation mod_php is to make PHP a built-in module for Apache. To enable the Apache HTTP server itself to support the PHP language, do not need every request to start the PHP interpreter to explain PHP.

More interested in PHP related content readers can view the site: "PHP Math Skills Summary", "PHP operation Office Document Skills Summary (including word,excel,access,ppt)", "PHP array" operation Skills Daquan, " PHP Sorting algorithm Summary, "PHP Common traversal algorithm and skills summary", "PHP Data structure and algorithm tutorial", "PHP Programming Algorithm Summary", "PHP Regular Expression Usage summary", "PHP operation and operator Usage Summary", "PHP string Usage Summary" and " A summary of common PHP database operation techniques

I hope this article is helpful to you in PHP programming.

http://www.bkjia.com/PHPjc/1133033.html www.bkjia.com true http://www.bkjia.com/PHPjc/1133033.html techarticle PHP Modular Installation tutorial, PHP Modular Tutorial This article describes the method of modular installation of PHP. Share to everybody for reference, concrete as follows: PHP (hypertext preprocessor) This door although ...

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.