W2K + Apache + MySql + PHP3 + PHP4 + PERL usage summary

Source: Internet
Author: User
Tags mysql functions one more line
There must be many friends who like me to try new things, especially when I hear that a software has a new version, I can't wait to download it and use it again. I would like to discuss with you the application of the following popular software. OS: MicrosoftWindows2000Professional simplified Chinese version WEBSERVER: Apache1 ApachePerl

There must be many friends who like me to try new things, especially when I hear that a software has a new version.
And a copy to be downloaded. 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 the "#" before ServerName, followed by the local IP address.
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

【★★★MySql quick installation★★★]

1. extract the mysql-shareware-3.22.34-win.zip to a temporary directory, and then run setup.exe to start installation,
Use the default value for installation.
2. run c: \ mysql \ bin \ mysqld-cmdware -- install to 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 as c: \ apache \ php3
2. Copy c: \ apache \ php3 \ php3.ini-dist to the c: \ winnt directory and change it to 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 and 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 and remove the semicolon.

【★★★PHP4 quick installation★★★]

1. extract the php-4.0.0-Win32.zip to a directory, such as c: \ apache \ php
2. Copy c: \ apache \ php. ini-dist to the c: \ winnt directory and change it to 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 and 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, such as 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 Packge, in
In Windows 2000, you can run it directly. follow the prompts to install it. the default installation path is c: \ perl. change it to 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 an Apache + MySql + PHP3 + PHP4 + PERL running environment without any errors! 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
C: \ apache Directory. The configuration file is c: \ apache \ conf \ httpd. conf. Usually, at least ServerName must be modified,
Remove the comment symbol "#", which is followed by the IP address. for LAN users with WINS, you can use the machine name, for networks with DNS
You can use a domain name. If ServerName is not set in Windows 2000, Apache cannot be started. Another influence is when
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
Then, localhost is replaced with the value specified by ServerName. if the value cannot be correctly parsed, it cannot be accessed. User configuration
You can add a project to httpd. conf or srm. conf. put all the configuration items in httpd. conf.
It is convenient to modify and maintain this configuration file and avoid conflicts (as described in the srm. conf file !). But httpd. conf does.
It is too big to search for a specific project. In addition, all configuration items added and modified by users are placed in
In srm. conf, this file is very small and easy to view and modify. I prefer the latter. In httpd. conf, other common possibilities of Apache
You need to modify the following settings:

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 rather than backslash.

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

AccessFileName. htaccess # the configuration file name accessed by the directory can be changed
# ". Htaccess", but 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. please click the Finish button or something like
And then quit. 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 your own directory.
Hope, for example, after moving to d: \ mysql, you need to edit d: \ mysql \ my-example.cnf (*. cnf file in Windows 2000
Will be registered as a SpeedDial file, which cannot be operated in the resource manager. you must use the command line to start notepad editing, such as running
Notepad d: \ mysql \ my-example.cnf, but this file is the UNIX system text file format, in notepad cannot be correct
Line, you can use write to open and edit, or use write to open and save it once, and then use notepad to edit it .) Find a row in basedir,
Remove the comment "#" and change the path to the moved Directory (the directory separator should use a slash instead of a backslash ).
Is: c: \ my. cnf MySql started in service mode. if you stop mysql with net stop, an error message is displayed, for example:

C: \> gt; 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 message, you can use the following command to stop
Stop:

C: \> gt; mysql \ bin \ mysqladmin-u root shutdown

If no message is displayed, MySql has been stopped successfully.

It must be noted that although MySql is known to be easy to install and use, it is an SQL-based database management system.
If you are not very familiar with SQL, you may not be able to do anything with it. There are many MySql management tools on the Internet, such as PHP3-based tools
PhpMyAdmin and MAP are based on Windows, including MySqlWinAdmin and myAdmin. PHP3 and PHP4 have many incompatible MySql functions.
Therefore, 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 a few dozen K, and phpMyAdmin also contains the simplified Chinese prompt, the phpMyAdmin_2.0.5.zip with the directory name is decompressed
C: \ apache \ htdocs directory, or other Alias directory, and then edit the file:

C: \ apache \ htdocs \ phpMyadmin \ config. inc. php3

Find:
Require ("english. inc. php3"); one 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 to: include_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.ini. Mentioned above
The following two parts are modified:

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 the path set by include_path
1. 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 expansion module cannot be loaded. The content in php3.ini is case sensitive! However, the Windows path
The name is case-insensitive.

[☆☆☆Php4 overview ☆☆☆]

PHP4 differs from PHP3 in many ways. The size of php. ini is almost twice the size of php3.ini. In the project and php3.ini to be modified
The two items are the same, include_path and extension_dir.

However, because of the built-in support of MySql, if you only use MySql, you do not need to modify extension_dir to keep the default value.
You can. 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. But there may be good people like me, using php. ini-
Optimized. As you know, PHP is extremely convenient for form processing. for tables using the post method
Single, PHP automatically generates variables with the same name according to the form name. almost all PHP programs use the automatically generated form variables in this way,
However, if you copy php. ini-optimized to the c: \ winnt directory and change it to php. ini, no automatic form variable is generated.
Success! 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 this off if you don't want
; To clutter your scripts 'global scope with user data. This makes
; Most sense when coupled with track_vars-in which case you can
; Access all of the GPC variables through 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.
If you only want to display the output in the browser, you can use readfile ("filename ").
It is an http or ftp URL.

2. to get the file name of this file, many people use $ PHP_SELF, but I think getenv ("PATH_INFO ");
Better. Use cases include:
    

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.