Apache2 + php-5.0.4-Win32 + mysql-4.0.18-win32 Configuration

Source: Internet
Author: User

OS win2003 System Disk: I: Disk

Step 1: install apache and configure support for PHP

Click the Installation File apache_2.0.50-win32-x86-no_ssl.msi
Install apache in the I: \ apache2 directory (As You Like)
Decompress the content in php-5.0.4-win32.zip to F: \ php-5.0.4-Win32
Find the php. ini-dist in the php Directory and rename it as php. ini and copy it to the I: \ windows directory.
Copy php5ts. dll and libmysql. dll in the php Directory to the system directory I: \ windows \ system.

Configure httpd. conf in apache
Open the file I: \ Apache2 \ conf \ httpd. conf.
Find the adddefadefacharset ISO-8859-1 and change it to adddefadefacharset GB2312 (to make the default language encoded as simplified Chinese)
Add Alias/myweb/"H:/myweb/" at the end of httpd. conf (I will put the file under the myweb folder of the H: disk)
Find DirectoryIndex index.html. var and add index.htm index. php.
To avoid unnecessary conflicts, I changed the port to 8888.
Listen 8888.

Select the installation mode: Modular installation or CGI installation (select the same)

-------------- Modular installation configuration ------------------------------------
Find the # LoadModule ssl_module modules/mod_ssl.so line, and add a line after this line
LoadModule php5_module I:/php-5.0.4-Win32/php5apache2. dll
Where d:/php/php5apache2. dll is the location of php5apache2. dll in your php Directory.
(Php-4.4.0-win32 version, php4apache2. dll in I:/php-4.4.0-Win32/sapi)
Find the AddType application/x-gzip. gz. tgz line, and add a line after this line
AddType application/x-httpd-php. php
---------------------------------------------------------------

-------------- CGI installation configuration --------------------------------------
Find AddType application/x-gzip. gz. tgz and add the following line:
ScriptAlias/php/"I:/php-5.0.4-win32 /"
AddType application/x-httpd-php. php
Action application/x-httpd-php "/php/php-cgi.exe"
---------------------------------------------------------------

At this time, the PHP environment is basically configured successfully.
Restart the apache service
Create a file named test.html in the WEB directory (for example, my H: \ mywebplugin) as follows:
<Html>
<Head>
<Title> test </title>
</Head>
<Body>
Test
</Body>
</Html>
Open http: // localhost: 8888/myweb/test.html in a browser
If "test" is displayed, the Apache configuration is successful.

In the WEB directory (for example, my H: \ myweb), create a file named test. php with the following content:
<? Echo phpinfo () ;?>
Open http: // localhost: 8888/myweb/test. php in a browser
If you can see the php configuration output information, OK

Step 2 install mysql

Install mysql in the specified directory. For example, if my package is C:/mysql, you can directly decompress the package to the specified directory.
Then click C: \ mysql \ bin \ winmysqladmin.exe, where C: \ mysql is your mysql installation directory.
Enter the initial user and password of winmysqladmin (note: this is not a user or password in mysql ).
After confirmation, a traffic light icon will appear in the Start bar of your task in the lower right corner. The red light indicates that the service is stopped.

Modify the root password of the mysql database
Run cmd to enter the following command: (Note: C: \ mysql is the mysql installation directory)
Cd C: \ mysql \ bin
Mysqladmin-u root-p password 123456
Enter
Enter password: (Note: You need to Enter the original password. The password is blank at the time of installation, so press Enter)
In this case, the root password of the mysql account is changed to 123456. installation is complete.

3. Configure php. ini and test mysql
(Php. ini is d: \ php. ini in windows)
Change extension_dir = "./" to extension_dir = "d:/php/ext"
Find
; Extension = php_mysql.dll
Replace ';'
Extension = php_mysql.dll
Found
; Session. save_path = "/tmp"
Remove ';' from the directory where you saved the session, as shown in figure
Session. save_path = "I:/php-5.0.4-Win32/session_temp ";

Restart the apache service
Restart the mysql server
The content of the file testdb. php created by H: \ myweb in the Web directory is as follows:
<? Php
$ Link = mysql_connect ('localhost', 'root', '123 ');
If (! $ Link) echo "fail ";
Else echo "success ";
Mysql_close ();
?>

Open http: // localhost: 8888/myweb/testdb. php In the browser. If success is output, it will be OK.

 

From: http://old.blog.edu.cn/user1/19735/archives/2005/1022250.shtml

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.