1.Install php4
software download:
http://www.php.net;
http://www.phpchina.com
http://phpuser.com
After getting the compressed package, unzip it to the c:php4 directory.
Copy php4ts.dll, msvcrt.dll to C:windowssystem
Rename php.ini-dist to php.ini and copy it to c:windows
Editing this file is very simple, just change a few options.
extension_dir = c:php4
extension =php_ldap.dll
extension =php_zlib.dll
extension =php_calendar.dll
extension =php_exif.dll
extension =php_ftp.dll
extension =php_mssql70.dll
extension =php_imap.dll
If there is, remove the semicolon in front of it; if not, add it yourself. It is recommended not to change this part first, otherwise errors may easily occur.
Appears here:
X-Powered-By: PHP/4.0.0
Content-type: text/html
Just because invalid or non-existent php_*.dll files are specified in the php.ini file, loading these error messages may also cause the browser to not be able to find the server. After a long and arduous wait, IE will give you Says:
Brother! The server cannot be found! Please send me my condolences...Haha!
It’s just that simple, and there’s more,
If the WEB Server you are using is PWS, then there is one more thing to change!
browscap = C:windowssysteminetsrvbrowscap.ini
And modify the PWS-php4.reg file
".php"="[PUT PATH HERE]\php4isapi.dll"
Changed to
".php"="C:\php4\php4isapi.dll"
Just point out the location of the php4isapi.dll file
You can also add other suffixes, the specific file is:
REGEDIT4
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices
w3svcparametersScript Map]
".php"="C:\php4\php4isapi.dll"
".php3"="C:\php4\php4isapi.dll"
".php4"="C:\php4\php4isapi.dll"
".phtml"="C:\php4\php4isapi.dll"
Save and exit, double-click to execute, and write to the registry!
Other detailed settings:
asp_tags = On ; Allow the use of ASP style tags<% %>
upload_max_filesize = 2097152;Maximum bytes of uploaded files
MySQL.default_host = localhost;
mysql.default_user = root;
mysql.default_passWord= yourpasswd;
The above settings about mysql can be completed in my.cnf. Only a few parts are given here, and the settings of other contents are left to everyone to explore by themselves!
include_path = path1;path2;path3....
When you use the include function, only files in the specified directory can be included.
About how to set doc_root and user_dir.
After setting doc_root, only the php files under the doc_root directory can be executed!
For example doc_root=c:php4test
Then the PHP file can only be interpreted and executed if it is placed in this directory.
When user_dir is not set, doc_root is read from the control file.
For example, the URL http://localhost/doc.php3 opens the doc.php3 file under c:php4test instead of c:PRogram
Files....doc.php3 file under htdocs. Regarding the setting of user_dir, I still haven’t figured it out yet. I hope experts can give me some advice!
2.Install APACHE1.3.12
Software acquisition: http://www.apache.org; http://www.phpchina.com; http://phpuser.com; http://www.phpsite.net.
The installation of the software is very simple. After downloading, double-click to install.
Configure the httpd.conf file in the conf directory.
#BindAddress *Change to BindAddress 127.0.0.1
#Servername new.host.name changed to Servername localhost
The reason for similar errors may be that the servername is not specified.
"cannot determine local host name,use servername to set it manually"
Ok, your apache is ready to run!
Run your apache. It should show:
Apache/1.3.12 (Win32) running...
Note, this assumes that your APACHE is installed in the default directory:
C:/Program Files/Apache Group/Apache
Otherwise, the serverroot and documentroot in the document will also need to be changed. For example, if you install it under c:apache. Then
serverroot = c:/apache docmentroot = c:/apache/htdocs
Other options follow suit
If your machine has other server programs installed, and you want them to work together for you, then you must change the port. The default is 80, you can change it to 81 or 8080. Do not use other commonly used ports such as 21 ,23,
25 and so on (nonsense^_^).
Okay, let’s let your APACHE support PHP4. Add the following sentences, and it’s basically all set!
ScriptAlias /php4/ "C:/php4/"
AddType application/x-httpd-php4 .php
AddType application/x-httpd-php4 .php3
AddType application/x-httpd-php4 .php4
Action application/x-httpd-php4 "/php4/php.exe"
;Do not write it as
;Action application/x-httpd-php4 "c:/php4/php.exe"
;Otherwise something will go wrong.
Find similar lines in httpd.conf and add them to make it easier to maintain. Regarding the default startup document: the default startup document of apache is index.html DirectoryIndex
index.html Change it to the default startup document you want
If you want to support more documents, it should be like this:
DirectoryIndex index.htm
DirectoryIndex index.php
DirectoryIndex index.php3
DirectoryIndex index.php4
Done! Write a test file:
phpinfo();
?>
Save as info.php
Enter http://localhost/info.php in the browser
Don’t forget to run APACHE first!
3.Install PWS
Software acquisition: WIN98 CD-ROM add-onspws directory. Haha, just setup it directly, no configuration required! After the installation is complete, run PWS, click Advanced to create a virtual directory, and click Edit Properties to modify its properties. The default is to read and there is an execution between the script, put a check in front, and select it. The PHP4 file under this directory is It's ready to run!
Pay attention to setting in PHP.INI file
browscap = C:windowssysteminetsrvbrowscap.ini
Without settings, it is impossible to run PHP4.
4. Install MYSQL (mysql-3.23.21-beta-win)
Software acquisition: foreign http://www.mysql.com; domestic http://www.phpchina.com; http://phpuser.com, http://www.phpsite.net.
Run the setup file to perform the installation. There should be no prompts after completion. At this time, mysql
It has been installed in your system. The default directory is: c:mysql
There is a file my-example.cnf under c:mysql. Rename it to my.cnf and copy it to c:.
No modification required!!!
You can add username, password, login host, database and port information!
Go to the c:mysqlbin directory. Double-click mysqld to execute! Under normal circumstances, the DOS window flashes by. It is recommended to open an MS-DOS window and enter
at the c:mysqlbin> prompt
mysqld
Execute MYSQL daemon!
[If there is no mysqld, there should be mysqld-shareware.exe to execute it and it will be the same]
If there are no prompts, it means there is no error! Your mysql has started running! You can try entering a few commands to test it:
C:mysqlbin>mysqladmin ping
Mysqld is alive
C:mysqlbin>mysqlshow
+-----------+
| Databases |
+-----------+
| mysql |
| test |
+-----------+
The above is normal!
Enter mysql to log in!
C:mysqlbin>mysql C:mysqlbin>mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 8 to server version: 3.23.21-beta-debug
Type 'help' for help.
mysql>
Remember to run mysqld before logging in, otherwise an error message like this will appear:
Can't connect to MySQL server on 'localhost' <10061>
Well, have you encountered it? Anyway, when I started running mysql, that was it!
5. Install Phpmyadmin VER:(phpMyAdmin_2.1.0)
This is an application written in php. You can copy it directly to the directory where php is executable and run it. For example
c:/program files/apache group/apache/htdocs/phpmyadmin/
Modify the config.inc.php3 file and change
require("english.inc.php3");
Change to
require("chinese_gb.inc.php3");
If your e-text is good enough, you don’t have to change it! Anyway, my E text is ^@#^%^%$&^&^*@$#@$#&*&*&*(()(#@!
Haha!
Okay, let’s execute the table creation task and see if it works!!!
I've finished talking, this is my approach! The built debugging environment is okay! I haven't found any problems yet! Since I am also a beginner in PHP, mistakes in the article are inevitable. I hope experts can criticize and correct me!
The above introduces the method of installing Apache+PHP4+MySQL+phpMyAdmin under Win98, including Win98 and installing Apache. I hope it will be helpful to friends who are interested in PHP tutorials.