Set up local PHP perl development for Windows 98

Source: Internet
Author: User
Tags ini mysql php file php script versions window zip perl script
Perl|window first step, prepare the required files.
Setting up PHP Local development for Windows is actually very simple, but the documentation for the use of these software is very difficult to understand and is in English. The following is a combination of experience, the specific installation methods, step-by-step elaboration.

Here are the Apche 1.3.11, PHP 4.04, Perl 5.001, and the MySQL 3.22.34, which describe their installation and debugging methods, but they also apply to any newer versions of these software. Before you start, be aware that if you have activestate for Perl installed, either reverse it or skip the installation section on Perl below, but indicate the path to the original Perl installation in the settings file. How to do it, the following will be described in detail.

The first step: Prepare the required documents

Download the following two files:
1. mysql3.22.34 Win 32-bit version share
2. Perl for Win32 5.001
Download the Apache 1.3.11 for Win 9x/nt.
Also need a browscap. INI file, which can be downloaded in the following places:
1. Http://asptracker.com/browscap.zip
2. http://cyscape.com/browscap/
Finally, download the latest version of PHP for Windows in http://www.php.net/, or download the php4.04 win 32-bit installer from this site.



Step two Software Installation

Extract the PHP file to "C:/php3".
The MySQL file is overwhelmed by a temporary directory, running the Setup.exe program, it will automatically install MySQL to "C:\mysql".
Unzip the Browscap.zip (containing the file Browscap.ini) and copy the Browscap.ini to the "C:\windows" directory.
Apache is automatically unpacked and installed, run the installation file, and it will be installed to "C:\program Files\apache group\apache" If the default value is used.
Unzip the Perl file anywhere, but here we assume the extract is in the "C:\perl" directory. There are two versions of Perl for Windows, and any one is available. Note that if Perl was previously installed, you must know the path to the Perl.exe file. The first line of any Perl script is usually a sentence similar to "!#/usr/bin/perl", which points to the actual physical path of Perl. If the path is "C:\perl" then this line should be "!#/perl\bin\mswin32-x86\perl", pointing to the Perl.exe file, but be careful not to add the extension ". exe". If you are using ActiveState for Perl, the same path also points to the "Perl.exe" of ActiveState.


The third step software setup

Set Apache:
1. Loaded in NotePad
"C:\program Files\apache group\apache\conf\httpd.conf".
This is the Apache settings file. Found in the file
"#ServerName New.host.name" (should be around 232 lines, but
Is that the number of rows may change in the new version. ) and change it to the following:

ServerName http://localhost

(Note: Be sure to remove "#", which represents the annotation, will be ignored by the server
The contents of the row)
2. At around 458 lines, add:
scriptalias/php3/"c:/php3/"
3. At around 506 lines, add:
AddType application/x-httpd-php3. php3
4. At around 643 lines, add:
Action application/x-httpd-php3 "/php3/php.exe"
5. At around 239 lines, the
DocumentRoot "C:/Program Files/apache group/apache/htdocs"
Change to any page root you want, and suggest making it the same as your remote server
directory structure, usually to create a "C:\usr\bin\html\" under C disk
Recorded. All the content you want Apache to serve (Web pages, for example)
PHP or Perl scripts) must be stored in the "DocumentRoot" specified
Directory.
6. The value of "documentroot" also needs to be changed around 264 lines.
7. Create a Cgi-bin directory for Perl scripts. Recommended as "/cgi-bin"
And, of course, this is the root of the documentroot mentioned in the 5th step above
Directories.
8. Around 458 lines (just the PHP settings that were added in step 2nd)
) Join the following line:
scriptalias/cgi-bin/"C:/dir"
The dir is the Cgi-bin directory mentioned in step 7th.
9. In about 465 lines, now may be
C:/Program Files/apache Group/apache/cgi-bin
Change it to the directory specified in step 8th.
10. Create a new PHP test file in NotePad, which is about something like

And so on, the specific PHP script here is not a bit, we see to do it. And then
Save it as "index.html" and put it in the DocumentRoot specified in step 5th.
Table of Contents.
Digression: If you can compare the familiar httpd.conf file each line of the meaning of the set, then you can have a general understanding of the workings of the acphe. It's not a good place to talk about (digress), but there's time to talk about it later.
To set up PHP:
1. Find the file in "C:/php3" php3-ini-dist
2. Change him to Php3.ini
3. Open it in NotePad
4. Find Extension_dir (about 100 lines) and change it to:
Extension_dir = C:\php3
5. Find in approximately 115 lines:
; Extension=php3_mysql.dll
To
Extension=php3_mysql.dll
6. In about 225 lines, change
; browscap = Extra/browscap.ini
For
Browscap = C:\windows
7. Put the modified file (Php3.ini) in the "C:\windows\" directory
8. Note Those who need to be removed "; "The line,"; "is the annotation tag for the PHP species
, you must remove it, or the entire line of statements will be ignored.

Fourth Step software Testing

Restart your computer.
Test Apache and PHP: Enter "http://localhost" in the browser, and if the installation is OK, you can see the index.html file that you just wrote.
If an error message appears, it is generally caused by the httpd.conf file. Check the settings in the line to see if the path is typed correctly.
Test MySQL: Open a DOS window, go to the "c:/mysql/bin/" directory, and enter the following statement:
Mysqld
Mysqlshow
Mysqlshow-u Root MySQL
Mysqladmin Version Status proc
Now you have logged on to the MySQL server.
Test Perl: Edit a test script in NotePad, as follows:
!#/perl\bin\mswin32-x86\perl
print "content-type:text/html\n\n";
print "Hello";
Save this file to the/cgi-bin/directory set in Apache. Open the script file just created in the browser, if successful, will show "Hello", if there are 500 errors, carefully check the first line of the script Perl.exe file has not been correctly specified.
Some things to be aware of: 1. You must first run Apache, then MySQL. Any changes to the Apache settings file httpd.conf will not take effect until after the server has been restarted. 2. To run the Perl script under a DOS window, simply correlate the ". pl" Extension with the Perl.exe program installed above in Windows Explorer, and then type "Perl script-to-run.pl" at the DOS prompt.
Other references (English)
PHP Installation
Clueless Lou ' s Page: Install Active State Perl on Apache
phpMyAdmin: Full Local run

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.