Home  >  Article  >  Backend Development  >  Win2000+Apache+MySql+PHP4+PERL installation and use summary_PHP tutorial

Win2000+Apache+MySql+PHP4+PERL installation and use summary_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:08:38856browse

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 use summary (1)
There must be many friends here who like to try new things like me, especially When I hear that
there is a new version of a certain software, I will definitely download a copy and use it later.
Here I would like to discuss with you the applications of the following popular software, in order to inspire others.

OS: Microsoft Windows 2000 Professional Simplified Chinese version
WEB SERVER: Apache 1.3.12 for WIN32
MYSQL: MySQL Shareware 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

【★★★ Apache Quick Install★★★】

1 . Run apache_1_3_12_win32.exe and install according to the prompts. The installation directory may be:
c:apache
2. Modify c:apachehttpd.conf, remove the "#" in front of ServerName, followed by
and the local one IP address
3. Run c:apacheapache -i to install Apache as a service in Windows 2000
4. Run net start apache to start Apache
5. Rename c:apachehtdocsindex.html.en to index. html, then
Enter in the browser address bar: http://localhost

【★★★ MySql Quick Installation★★★】

1. Change mysql-shareware-3.22 .34-win.zip Unzip to a temporary directory,
Then run setup.exe to start the installation, install everything with default values ​​
2. Run c:mysqlbinmysqld-shareware --install
Mysql is installed as a service in Windows 2000
3. Run net start mysql to start the mysql service

【★★★ PHP3 quick installation★★★】

1. Change php- Unzip 3.0.15-win32.zip to a directory, such as
c:apachephp3
2. Copy c:apachephp3php3.ini-dist to the c:winnt directory,
and rename it to php3. ini
3. Modify c:apacheconfsrm.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 be run, create a file c:apachehtdocsinfo.php3 ,
There is only one line of content:

Then enter in the browser address bar: http://localhost/info.php3
5. In order to add support for MySql, you need to edit c:winntphp3. ini,
Find extension_dir and change the line to:
extension_dir = "c:apachephp3"
Then find
; extension=php3_mysql.dll
Remove the semicolon in front of it

【★★★ PHP4 quick installation★★★】

1. Extract php-4.0.0-Win32.zip to a directory, such as
 c:apachephp
2. Copy c:apachephpphp.ini-dist to the c:winnt directory
and rename it to php.ini
3. Copy c:apachephpphp4ts.dll to the c:winntsystem32 directory
4. Modify c:apacheconfsrm.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:apachehtdocsinfo.php,
The content is only One line:
 
 Then enter in the browser address bar: http://localhost/info.php
 PHP4 has built-in support for MySql, no additional settings are required

【★★★ Zend Optimizer for PHP4 quick installation★★★]

1. Extract ZendOptimizer-Beta4-WindowsNT.zip to a directory,
For example, c:apachezend
2. Modify c:winntphp. ini, add the following two lines anywhere:
zend_optimizer.optimization_level=7
zend_extension_ts="c:apachezendZendOptimizer.dll"
3. Refresh info.php in the browser, you can see this much One line:
 with Zend Optimizer v0.98, Copyright (c) 1998-2000, by Zend Techno
logies

【★★★ Active Perl Quick Install★★★】

1. Double-click ActivePerl-5.6.0.613.msi to run it. This is an installation package in Windows
Installer Packge format. It can be run directly
under Windows 2000. Follow the prompts to install. The default installation path is c :perl, you might as well change it to
 c:usr
2. Modify c:apachesrm.conf and add the following line:
AddHandler cgi-script .pl
3. Add in the first line of the PERL program Above:
#!/usr/bin/perl
4. In order to allow Apache to recognize *.cgi programs, add:
AddHandler cgi-script .cgi
to srm.conf The local PERL CGI program can be completely consistent with the one on the UNIX host
In order to allow Apache to handle Server Side Include, add in srm.conf:
AddType text/html .shtml
AddHandler server -parsed .shtml
In this way, the CGI program can be run in SSI mode
5. In order for the above modifications to take effect, you need to restart Apache (net stop apache, net start
apache)


Follow the above steps completely, and you will have the running environment of
Apache+MySql+PHP3+PHP4+PERL without making any mistakes! In fact,
the above method is also feasible in Windos NT4.0+SP3+.

【☆☆☆ Apache Overview☆☆☆】

The default installation directory of Apache is c:program filesapache groupapache,
But for convenience, you might as well install it to c: under the apache directory.The configuration file is
c:apacheconfhttpd.conf. Usually at least the
item that needs to be modified is the ServerName. Remove the comment symbol "#". The simplest is to follow the IP address. For LANs with WINS
Users can use machine names, and network users with DNS can use domain names. Under
Windows 2000, not setting ServerName will cause Apache to fail to start.
Another impact is when using Alias ​​in the following way:
Alias ​​/userdir "c:/userdir/"
If called like this:
http://localhost/userdir/
It will not cause any problems, but if it is called like this:
http://localhost/userdir
then localhost will be replaced by the value specified by ServerName. If this value cannot be
parsed correctly, it will not be accessible. .
User configuration items can be added to httpd.conf or srm.conf. One is to put
all configuration items in httpd.conf, so that only this
configuration needs to be modified and maintained. file, which is more convenient and avoids conflicts (this is what the srm.conf file says!).
But httpd.conf is indeed too large, and it is not easy to search for specific items in it.
Another suggestion is to put all configuration items added and modified by users in srm.conf.
This file is small and easy to view and modify. I prefer the latter.
In httpd.conf, other commonly used settings of Apache that may need to be modified are:
ServerAdmin your@email.address #The administrator’s e-mail address

DocumentRoot "c:/apache /htdocs" #Default root path
Note that the paths are all separated by slashes instead of backslashes

DirectoryIndex index.html index.php index.php3 index.htm index.shtml
This item specifies the default documents and their order in each directory

AccessFileName .htaccess #Configuration file name for directory access
Using the resource manager, you will find that you cannot rename a file to ".htaccess ”, but
it can be used in the command line mode, and it can also be saved as this file name using notepad.

【☆☆☆ MySql Overview☆☆☆】
The default installation directory of MySql is c:mysql. After the installation is completed, there will be no prompt message saying that the installation is complete. Please click the Finish button or something like that, directly Just quit. If you need to install to another directory, it is recommended to install it to c:mysql first, and then move the entire directory to where you want. For example, after moving to d:mysql, you need to edit d:mysqlmy-example.cnf (*.cnf files are in It will be registered as a SpeedDial file in Windows 2000 and cannot be operated in the resource manager. You need to use the command line to start notepad editing, for example, run notepadd:mysqlmy-example.cnf, but this file is a text file format under the UNIX system. Line breaks cannot be done correctly in notepad. You can use write to open it for editing,
or use write to open it and save it once, and then use notepad to edit it.) Find the basedir line, remove the "#" comment in front, and change the path behind it. is the moved directory (the directory separator should use a slash instead of a backslash), and then save it as: c:my.cnf
If MySql started in service mode is stopped with net stop mysql, an error will be obtained Message, for example:
C:>net stop mysql
The MySql service is stopping.
System error.
A 1067 error occurred in the system.
The process terminated unexpectedly.
 MySql service has been stopped successfully.
It doesn't matter, MySql has indeed stopped. But if you don’t want to see any error messages
, you can use the following command to stop:
 C:>mysqlbinmysqladmin -u root shutdown
If there is no prompt message, it means that MySql has been stopped successfully.
It should be noted that although MySql claims to be simple to install and easy to use, it is a database management system based on SQL after all, so if you are not very proficient in SQL, you probably won’t be able to do anything with it. There are many tools for managing MySql on the Internet, such as phpMyAdmin and MAP based on PHP3, and MySqlWinAdmin and myAdmin based on Windows. Since there are many incompatibilities between the MySql functions of PHP3 and PHP4, I recommend installing both PHP3 and PHP4 in Apache. These two small programs can be downloaded here:
http://www.nease.net/~yzwang/php/
Both are only a few dozen K, and phpMyAdmin also contains simplified Chinese prompts. Change phpMyAdmin_2 .0.5.zip Unzip with the directory name to the c:apachehtdocs directory, or other directories where Alias ​​is set, and then edit the file: c:apachehtdocsphpMyadminconfig.inc.php3 Find inside:
require("english.inc .php3");
line, replace it with: require("chinese_gb.inc.php3");
and save. One more thing that must be done before starting it is to edit c:winntphp3.ini.
Find the include_path line in it and modify it to:
 include_path = "c:apachehtdocsphpmyadmin"
Save it in Enter in the browser address bar:
http://localhost/phpmyadmin/index.php3
Do you see it? It says -> "Welcome to phpMyAdmin 2.0.5"!

【☆☆☆ Overview of PHP3☆☆☆】

PHP3 seems to have nothing else that requires special settings. The only file that needs to be modified is php3.in

i.
The two parts to be modified have been mentioned above:
 include_path = "c:apachehtdocsphpmyadmin;c:apachehtdocs"


Anytime include or require is used in PHP3, what should be included? The file must be in one of the paths set by
include_path. Fortunately, the modification to php3.ini will take effect immediately.
There is no need to restart apache.
Extension_dir = "c:program filesapachephp3"
This item is also required, otherwise the extension module cannot be loaded.
The content in php3.ini is case-sensitive! However, the case of Windows path names does not matter.

【☆☆☆ Overview of PHP4】☆☆☆】

There are many differences between PHP4 and PHP3. The size of php.ini is almost double that of php3.ini.
The items to be modified are the same as the two items in php3.ini, include_path and extension_dir.


However, due to the built-in MySql support, if you only use MySql, you don’t even need to modify extension_dir
, just keep the default value. PHP4 provides two php.ini versions to choose from:
php.ini-dist
php.ini-optimized
If you use php.ini-dist, there is no problem in use. But maybe there are
good guys like me who use php.ini-optimized and they will encounter major problems.
As we all know, PHP is extremely convenient for form processing. For forms that use the post method,
PHP will automatically generate variables with the same name based on the name of the form. Almost all PHP programs use automatic methods like this. Generated form variables, however, if you copy php.ini-optimized
to the c:winnt directory and rename it to php.ini, there will be no automatic form variable generation!
Look carefully at php.ini-optimized, there is this paragraph:
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, it is recommended to change it to:
Register_globals = On

Actually, I don’t have much experience in using PHP, but I still noticed the following problems:
1 . When you need to include another file, you can use include or require.
But it requires path setting in php.ini. If the purpose of including the file is just to display the output in the browser, you can use
readfile("filename");
and the parameter can also be the URL of http or ftp.
2. To get the file name of this file, many people use $PHP_SELF, but I think it is better to use getenv("PATH_INFO");
. Examples of usage scenarios include:
An array variable, each line of the file will become each item in $contents. The array index is from 0 to count($contents).
The software can also be downloaded from the following address, only 41K:
http://www.nease.net/~yzwang/php/
It should be noted that this version is
Zend Optimizer Beta4 for PHP4.0.0 for WindowsNT, version number is 0.98.
Can only be used on the above version of PHP4.0.0 for WIN32.
【☆☆☆Active Perl Summary☆☆☆】
Active State. ActivePerl 5.6 is the most popular latest version of PERL interpreter. I don’t understand why it is so big? It is almost the size of Apache and MySql combined. But this is the complete version of PERL and contains various modules of PERL5. It is installed in the c:usr directory because in this way, PERL's CGI program can use the same SHABANG line as under UNIX:
#!/usr/bin/perl
Of course, use it in Windows format You can also:
#!c:usrbinperl.exe
In this way, the PERL program debugged on your own machine can be uploaded to the UNIX host for use without modification, which is much more convenient. The programming issues about PERL are not discussed in this article. Within the scope.
This article is intended to inspire others. I also hope that everyone can share their experience in using PHP and its related environments with netizens and make progress together. 🎜>
Original author: 1000script
Source: 1000script.com


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/314828.htmlTechArticleWindows 2000+Apache+MySql+PHP3+PHP4+PERL installation and use summary www. 1000script.com 2002-9-3 1000script professional script Windows 2000+Apache+MySql+PHP3+PHP4+PERL installation and use summary (1) This...

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn