I, the work before configuration
Before configuring, it is going to find a suitable place to download. Now, PHP has developed to PHP4, so I just introduced the PHP4 installation configuration to everyone, in fact, PHP3 configuration and php4 are almost almost. In addition, considering that I use Linux to use less, and most people use WIN systems, so on this site only will be configured under WIN.
Personally, the best PHP4 download location is:
http://www.mm4.de/
This site is updated quickly, and the PHP4 of the station contains a lot of features.
The version I used is updated on August 20th, I tried it, it is not bad.
The PHP4 provided by this station is as follows:
Bcmath (Build-in), Calendar, Com (Build-in), CPDF, CURL, Cybercash, DB, Domxml, EXIF, FDF, FTP, GD, GetText, IFX (Informix), IMAP, Interbase, Java, LDAP, MSSQL65 , MSSQL70, MySQL (Build-IN), OCI8, ODBC (Build-IN), PCRE (Build-in), PDF, PGSQL, Session (Build-IN), WDDX (Build-in), XML (Build-in) ZLIB
(Before installing, please don't ask me what I want, my mysql.dll, see the above "MySQL (Build-in)" should know that PHP4 has been included, do not need a DLL file)
Basic settings for II, PHP4
(1) The file name I download is "php4.0.2-dev_win32-20000816.zip", unzipped to C: / PHP
(2) Move C: /PHP/php.ini to your Windows directory, Win98 default C: / Windows, NT / Win2000 defaults to C: / Winnt, (you can do this, but in order to match php3, You'd better do this, because this is not wrong)
(3) Take some content in the php.ini file:
UPLOAD_TMP_DIR = C: / TEMP
This is used for file uploading, saving you temporary file, if you set up C: / TEMP, you must have a C: / TEMP directory, and can be written by anyone, otherwise your file upload Will fail.
Also, for [Java], if you don't need it, you can remove it.
To explain, the basic functional configuration of PHP4 is relatively simple, but there are some complicated things, such as Javabean, the configuration is a bit difficult, I have been configured for a long time, I have been asked for many masters during the period.
III, WIN2000 / WIN98 APACHE PHP4 configuration
1. Introduction to APAHCE
According to the web server investigation company Netcrafe (http://www.netcraft.co.uk/survey/) survey, more than 50% of the Web server in all INTERNET is using Apache. Apache and MS IIS are the web server.
Second, Apache installation (refers to Windows version)
Unzip the downloaded file, to a directory, run the setup program, prompt the entire installation process. For example, install it to a directory (C: / Apache /). Then, there is a text file named httpd.conf under the word record in the directory, edit it with the text editor, change the "#bindaddress *" this line to "Bindaddress 127.0.0.1", will "#ServerName New .host.name "changed to" ServerName Localhost ". Ok, it's so simple and starts running apache, then entering: http://127.0.0.1/ should see the effect of the Apache server should be seen in the browser. What needs to be explained is that if your local machine is already running a further web server, you can distinguish between the modification port, you can change to "Port 81" or other in the httpd.conf file. No ports running the service. In general, the FTP port is 21 ..., then you can enter "http://127.0.0.1:81" in your browser.
Third, set the Apache virtual directory in IIS and PWS, which is performed by the graphical interface. In Apache, it is also an editing httpd.conf file (note: This file is generally not easy to change), add a line in this file.
Alias / Test / "C: / PHP / TEST /"
Indicates that you set the C: / PHP / TEST / directory to virtual directory / test /, then you can enter "http://127.0.0.1/test in the browser in C: / PHP / TEST / file" http://127.0.0.1/test / File Access.
Fourth, let Apache support PHP well, the simple configuration of the Apache server is, but it is necessary to support PHP and you need to do the following.
Add the following lines in the httpd.conf file:
Scriptalias / PHP / "C: / PHP /"
AddType Application / X-httpd-php .php
Action Application / X-httpd-php "/ php/Php.exe"
Of course, if you want to change your PHP file suffix to another, you can change the last few words in the second line to the suffix you want, you can support more files, you can Such as:
Scriptalias / PHP / "C: / PHP /"
AddType Application / X-httpd-php .php
AddType Application / X-httpd-php .php4
AddType Application / X-httpd-php .phtml
Action Application / X-httpd-php "/ php/Php.exe"
Ok, restart the Apache server, let us see if there is any success. Write a simplest PHP file in the Test virtual directory (Hello.php):
echo "HelloWorld!";?>
See if there is any success in the browser (http://127.0.0.1/test/hello.php)? Ok, we use
phpinfo ();?>
Take a look at the PHP configuration!
IV, WIN2000 / WIN98 IIS5 PHP4 configuration
First, CGI mode installation
Enter IIS Manager
Site Properties -> Home Directory -> Configuration -> Application Mapping -> Add
Enter ".php" or other name you want in ".php" or other name you want in "C: /PHP/PHP.EXE" "Extended"
Second, ISAPI mode installation
Enter IIS Manager
Site Properties -> ISAPI Filter -> Add
"Filter Name" input ".php", etc.
"Executable File" Select "C: /PHP/SAPI/php4isapi.dll"
Third, it is necessary to pay attention to the use of IIS, must pay attention to the issue of permission, when you appear "Can't find this page", it is possible to be this problem, in addition, I personally like to use CGI.
V, WIN2000 / WIN98 MYSQL installation
I. Introduction to MySQL
MySQL is a small Qi Qi database server software, which is ideal for medium and small applications. In addition to supporting standard ANSI SQL statements, it is most important that it also supports multiple platforms, and mysql supports multi-threaded operations on UNIX / Linux systems, which can get considerable performance. It is the same as the first two software, it belongs to the open source code soft.
Second, MySQL installation (referring to the Windows version) decompress the downloaded file, to a directory, run the setup program, prompt the entire installation process. It is installed by default to C: / MySQL. If you want to install some things, as an initiator, you can install it in the default directory. Ok, after installation, enter the c: / mysql / bin directory, run the mysqld-shareware.exe file directly under Win98, normally, no prompt information can be entered in NT: mysqld-shareware --Install startup The service then inputs mysql, and then a few lines of prompt information will appear and the prompt symbol appears: mysql>, you have successfully installed MySQL.
Third, setting the MySQL user password MySQL database default user name "root" (MS SQL Server SA Similar), the password is default empty. Enter c: / mysql / bin> mysqladmin -u root -p password adminpassword under the DOS prompt (notice, not a mysql prompt)
After entering the bus, you will prompt you for the original password. Since the original password is empty, go directly to the car, the root user's password is changed to "adminpassword".
Fourth, simply use the mysql database
1. Display mysql database (Note: After the next part, if there is no prompt, the input command is in the MySQL prompt)
Show Databases
2. Open a database
Use test
Where TEST is the database name
3. Display all data tables in a database (you must open a database)
Show tables
Go
4. Create a database as root (under the DOS prompt symbol)
Mysqladmin -u root -p password adminpassword create GSBOOK
Then you will prompt you to enter your password.
Because our purpose is to make a message board, I am named "GSBOOK" here.
5. Add data sheet in the database
Create Table Gsbook (ID INT Not Null Auto_Increment, Primary Key (ID), Nickname Varchar (30), Email Varchar (30), HomePage Varchar (30), Note Text, W_TIME DATIME)
Go
Explanation, in the future, I will express my mysql field type, if I don't understand it now, don't matter. Congratulations, until now, you already have the basic environment of PHP programming.