Win2000 + Apache + MySql + PHP4 + PERL installation and usage summary

Source: Internet
Author: User
Tags one more line perl interpreter
Win2000 + Apache + MySql + PHP4 + PERL installation and usage summary, read Win2000 + Apache + MySql + PHP4 + PERL installation and usage summary, windows2000 + Apache + MySql + PHP3 + PHP4 + PERL installation and usage summary www. 1000script. com2002-9-31000scrip

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
In the browser address bar, enter:

【★★★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:
  
In the browser address bar, enter:
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:
  
In the browser address bar, enter:
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. add the following to the first line of the PERL program:
#! /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:

There will be no problems, but if you call it like this:

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 ess # administrator's email 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:

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:
    
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:

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

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.