Win2000 + Apache + MySQL + PhP4 + Perl installation and usage Summary

Source: Internet
Author: User
Tags one more line perl interpreter

Windows 2000 + Apache + MySQL + php3 + PhP4 + Perl installation and usage Summary
Www. 1000script.com 2002-9-3 1000script professional script
Windows 2000 + Apache + MySQL + php3 + PhP4 + Perl installation and usage Summary (1)
There must be many friends who like me to try new things, especially when I hear
When a new version of software is available, you can't wait to download a copy of it.
I would like to discuss with you the application of the following popular software.

OS: Microsoft Windows 2000 Professional Simplified Chinese version
Web server: Apache 1.3.12 for Win32
MySQL: MySQL connector ware 3.22.34 for Win32
Php3: PhP 3.0.15 for Win32
PhP4: PHP 4.0.0 for Win32
Zend: Zend optimizer beta4 for PHP 4.0.0 for Win32

【★★★Quick Apache installation★★★]

1. Run apache_1_3_12_win32.exe. Follow the prompts to install apache_1_3_12_win32.exe. The installation directory may be:
C: \ apache
2. Modify c: \ apache \ httpd. conf and remove "#" before servername.
IP address of the Local Machine
3. Run c: \ apache-I to install Apache as a service in Windows 2000.
4. Run Net start Apache to start Apache
5. Rename c: \ apache \ htdocs \ index.html. En to index.html, and then
Enter http: // localhost in the address bar of the browser.

【★★★MySQL quick installation★★★]

1. Extract the mysql-shareware-3.22.34-win.zip to a temporary directory,
Run setup.exe to start installation. Use the default value for installation.
2. Run c: \ mysql \ bin \ mysqld-policware -- install
Install MYSQL as a service in Windows 2000
3. Run Net start MySQL to start the MySQL service.

【★★★Php3 quick installation★★★]

1. Extract the php-3.0.15-win32.zip to a directory, such
C: \ apache \ php3
2. Copy c: \ apache \ php3 \ php3.ini-Dist to the C: \ WINNT directory,
And renamed php3.ini
3. Modify c: \ apache \ conf \ SRM. conf and add the following lines:
ScriptAlias/php3/"C:/Apache/php3 /"
Addtype application/x-httpd-php3. php3
Action application/x-httpd-php3 "/php3/php.exe"
4. Restart Apache (net stop Apache, Net start Apache)
Php3 can run. Create a file c: \ apache \ htdocs \ info. php3,
There is only one line of content:

Enter http: // localhost/info. php3 in the address bar of the browser.
5. To support MySQL, edit c: \ winnt \ php3.ini,
Find extension_dir and change the row:
Extension_dir = "C: \ apache \ php3 \"
Find
; Extension = php3_mysql.dll
Remove the semicolon.

【★★★PhP4 quick installation★★★]

1. Extract the php-4.0.0-Win32.zip to a directory, such
C: \ apache \ PHP
2. Copy c: \ apache \ PHP. ini-Dist to the C: \ WINNT directory,
And renamed it PHP. ini.
3. Copy c: \ apache \ PHP \ php4ts. DLL to the C: \ winnt \ system32 directory.
4. Modify c: \ apache \ conf \ SRM. conf and add the following lines:
ScriptAlias/PHP/"C:/Apache/PHP /"
Addtype application/X-httpd-PHP. php
Action application/X-httpd-PHP "/PHP/php.exe"
5. Restart Apache (net stop Apache, Net start Apache)
PhP4 can be run. Create a file c: \ apache \ htdocs \ info. php,
There is only one line of content:

Enter http: // localhost/info. php in the address bar of the browser.
PhP4 has built-in support for MySQL and does not require additional settings

【★★★Zend optimizer for PhP4 quick installation★★★]

1. Extract the ZendOptimizer-Beta4-WindowsNT.zip to a directory,
For example, c: \ apache \ Zend
2. Modify c: \ winnt \ PHP. ini and add the following lines anywhere:
Zend_optimizer.optimization_level = 7
Zend_extension_ts = "C: \ apache \ Zend \ zendoptimizer. dll"
3. Refresh info. php In the browser and you can see that there is one more line:
With Zend optimizer v0.98, copyright (c) 1998-2000, by Zend techno
Logies

【★★★Quick installation of active Perl★★★]

1. Double-click the ActivePerl-5.6.0.613.msi to run, this is a Windows
Installer packge-format installation package, which can be directly used in Windows 2000
Run the command and follow the prompts to install it. The default installation path is c: \ Perl.
C: \ USR
2. Modify c: \ apache \ SRM. conf and add the following line:
Addhandler CGI-script. pl
3. In PerlProgramAdd:
#! /Usr/bin/perl
4. To enable Apache to recognize *. cgi programs, add the following to SRM. conf:
Addhandler CGI-script. cgi
In this way, the local perl cgi program can be completely consistent with that on the unix host.
To enable Apache to process server side include, add the following to SRM. conf:
Addtype text/html. shtml
Addhandler server-parsed. shtml
In this way, the CGI program can be run in SSI mode.
5. To make the preceding changes take effect, restart Apache (net stop Apache, Net start
Apache)

After performing the preceding steps, you will have
Apache + MySQL + php3 + PhP4 + Perl running environment! In fact,
The above method is equally feasible in ipvs NT4.0 + SP3 +.

[☆☆☆Apache summary ☆☆☆]

The default installation directory of Apache is c: \ Program Files \ apache group \ apache,
For convenience, install it in the C: \ Apache directory. The configuration file is
C: \ apache \ conf \ httpd. conf. Usually, the servername parameter must be modified at least.
The comment symbol "#" is removed, the simplest is followed by the IP address, for a wins
Local Network users can use the machine name, and domain names can be used for network users with DNS. In
If servername is not set in Windows 2000, Apache cannot be started.
Another influence is that when alias is used as follows:
Alias/userdir "C:/userdir /"
Assume that:
Http: // localhost/userdir/
There will be no problems, but if you call it like this:
Http: // localhost/userdir
The localhost is replaced with the value specified by servername.
If it is parsed correctly, it cannot be accessed.
You can add your configuration items to httpd. conf or SRM. conf.
All configuration items are placed in httpd. conf, so you only need to modify and maintain this
The configuration file is convenient and avoids conflicts (as described in the SRM. conf file !).
However, httpd. conf is too large to search for a specific project.
In addition, all configuration items added and modified by users are put in SRM. conf,
This file is small and easy to view and modify. I prefer the latter.
In httpd. conf, other common settings of Apache may need to be modified:
Serveradmin your@email.address # administrator's e-mail address

DocumentRoot "C:/Apache/htdocs" # default root path
Note that all paths are separated by diagonal lines instead of backslash.

Directoryindex index.html index. php index. php3 index.htm index.shtml
This item specifies the default document in each directory and its sequence

Accessfilename. htaccess # configuration file name for Directory Access
The resource manager will find that a file cannot be renamed as ". htaccess",
In the command line mode, you can use notepad or save it as the file name.

[☆☆☆Mysql summary ☆☆☆]
The default installation directory of MySQL is c: \ mysql. After the installation is complete, there is no message indicating that the installation is complete. Click the finish button and then exit. If you want to install it in another directory, we recommend that you first install it in c: \ mysql, and then move the entire directory to the desired place. For example, after moving it to D: \ mysql, You need to edit D: \ mysql \ my-example.cnf (*. the CNF file is registered as a speeddial file in Windows 2000 and cannot be operated in the resource manager. Use the command line to start notepad editing, such as running notepadd: \ mysql \ my-example.cnf, however, this file is in the format of a text file in the Unix system. You can use write to open and edit the file because it cannot be entered correctly in notepad,
Or use write to open and save it once, and then use NotePad to edit it .) Find a line in basedir, remove the comment "#", change the path to the moved directory (the directory separator should use a slash instead of a backslash), and save it as: C: \ My. CNF
If a MySQL instance started in service mode is stopped using net stop MySQL, an error message is displayed, for example:
C: \> net stop MySQL
The MySQL service is stopping.
System error.
The system has a 1067 error.
The process stops unexpectedly.
The MySQL service has been stopped successfully.
This does not matter. MySQL has indeed stopped. However, if you do not want to see any error messages
You can use the following command to stop:
C: \> MySQL \ bin \ mysqladmin-u root Shutdown
If no message is displayed, MySQL has been stopped successfully.
It should be noted that although MySQL is known to be simple to install and easy to use, it is an SQL-based database management system after all. If it is not very proficient in SQL, I am afraid it cannot be used for anything. There are many MySQL management tools on the Internet, such as phpMyAdmin and map based on php3, and mysqlwinadmin and MyAdmin Based on Windows. Because php3 and PhP4 have many incompatible functions in MySQL, we recommend that you install php3 and PhP4 simultaneously in Apache. These two applets can be downloaded here:
Http://www.nease.net /~ Yzwang/PHP/
Only dozens of K, and phpMyAdmin also contains a simplified Chinese prompt. Decompress phpmyadmin_2.0.5.zip with the directory name to the C: \ apache \ htdocs directory, or other alias directory, and then edit the file c: \ apache \ htdocs \ phpMyAdmin \ config. inc. in php3, find:
Require ("English. Inc. php3 ");
Line, replace it with: require ("chinese_gb.inc.php3 ");
Save the settings. Edit c: \ winnt \ php3.ini,
Find a line in include_path and change it:
Export de_path = "C: \ apache \ htdocs \ phpMyAdmin"
Save and enter the following in the address bar of the browser:
Http: // localhost/PHPmyAdmin/index. php3
No? It says --> "Welcome to phpMyAdmin 2.0.5 "!

[☆☆☆Php3 overview ☆☆☆]

Php3 does not seem to have any other things that require special settings. The only file to be modified is php3.in.

I.
The two parts to be modified have been mentioned above:
Export de_path = "C: \ apache \ htdocs \ phpMyAdmin; C: \ apache \ htdocs"

If you use include or require in php3, the file to be included must be in
One of the paths set by include_path. It takes effect immediately after php3.ini is modified,
You do not need to restart Apache.
Extension_dir = "C: \ Program Files \ apache \ php3 \"
This item is also required; otherwise, the extension module cannot be loaded.
The content in php3.ini is case sensitive! However, Windows pathnames are case-insensitive.

[☆☆☆Php4 overview ☆☆☆]

PhP4 differs from php3 in many ways. The size of PHP. INI is almost twice the size of php3.ini.
The project to be modified is the same as the two items in php3.ini, include_path and extension_dir.

However, because of the built-in support of MySQL, if only MySQL is used, then extension_dir
You do not need to modify the default value. PhP4 provides two available PHP. ini versions:
PHP. ini-Dist
PHP. ini-optimized
If php. ini-Dist is used, there is no problem in use. However, there may be
If I use PHP. ini-optimized, a major problem may occur.
As you know, PHP is extremely convenient for form processing. For forms using the POST method,
PHP automatically generates variables with the same name based on the form name. Almost all PHP programs are
In this way, automatically generated form variables are used. However, If php. ini-optimized is copied
In the c: \ WINNT directory and renamed PHP. ini, no automatic form variables are generated!
Take a closer look at PhP. ini-optimized, which has the following section:
Register_globals = off; whether or not to register the EGP

CS variables as global
; Variables. You may want to turn t

His off if you don't want
; To clutter your scripts 'Global SC

Ope with user data. This makes
; Most sense when coupled with track

_ Vars-in which case you can
; Access all of the GPC variables th

Rough the $ HTTP _ * _ vars [],
; Variables.
To correctly run the PHP sample program written by others, we recommend that you change it:
Register_globals = on

In fact, I still have a lot of experience using PHP, but I still noticed the following issues:
1. You can use include or require to include another file.
However, the path must be set in PHP. ini. Assume that the object is only
You can use
Readfile ("FILENAME ");
The parameter can also be an HTTP or ftp url.
2. To get the file name of this file, many people use $ php_self, but I think it is used
Getenv ("path_info ");
Better. Use cases include:
">
3. to read the entire file, simply use:
$ Contents = file ("FILENAME ");
$ Contents will become an array variable, and each row of the file will become
$ Contents. The array subscript ranges from 0 to count ($ contents ).
[☆☆☆Zend optimizer for PhP4 overview ☆☆]
The software can also be downloaded from the following address, only 41 K:
Http://www.nease.net /~ Yzwang/PHP/
Note that this version is
Zend optimizer beta4 for php4.0.0 for WindowsNT, version 0.98.
It can only be used in php4.0.0 for Win32.
[☆☆☆Overview of active Perl ☆☆☆]
ActivePerl 5.6 of active state is the latest popular perl interpreter. Why is it so large as 8174k? The size is almost the sum of Apache and MySQL. However, this is a full version of Perl, including the perl5 modules. It is recommended to install it in the C: \ USR directory because the CGI program of Perl can be the same as the shabang line in UNIX:
#! /Usr/bin/perl
Of course, it can be used in Windows format:
#! C: \ USR \ bin \ perl.exe
In this way, the debugged Perl program can be uploaded to the unix host without modification, which is much more convenient. Perl programming is not covered in this article.
This article aims to encourage others to communicate with friends from other places. I also hope that you can share your experiences in using PHP and related environments with your friends and make common progress.

Original Author: 1000 script
Source: 1000script.com

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.