Windows2003 under the installation of PHP5 + MYSQL4.0 + Apache2.52

xiaoxiao2021-03-06  115

Title: Windows2003: PHP5 MYSQL4.0 Apache 2.52 Installing Author: Stangly Wrong

Since PHP5 may exist bug caused by using IIS6.0 in Win2003, there is an error problem, and the error message is as follows:

PHP HAS ENCOUNTERED An Access Violation at 01 ******

I check the previous day on php.net, and I have not found the corresponding solution. So I have to use the Apache method to implement the web server.

This example uses the CGI mode, relatively convenient, simple configuration.

The specific method is as follows:

1. Download the mysql database, this example uses 4.0 version, the latest release of PHP5, Apache 2.0 latest release. You can download three websites from www.mysql.com www.apache.com www.php.net

2. Install MySQL, install it with next mode, keep the default setting, go all the way. Then run (assuming to install in the C: /mysql/bin/winmysqladmin.exe file, casually fill in a user and pass. Then automatically Register MySQL as a service for WIN. Self-started state

3. Install Apache, the same next method, all the way. When prompted, you can do it in IE. Use the following address: http:// localhost / check if there is Apache Welcome page

4. Extract the PHP5 compression package to the C: / PHP directory, the recommended directory is C: / PHP, otherwise you have to change a lot.

5. Create a C: /PHP/Php.ini-Dist file to php.ini. Modify the extensions directory for extension_dir = "c: / php / ext /" corresponding to your C: / PHP directory EXTENSIONS table of Contents

6. Modify the session directory to C: / TMP or point to an existing directory, used to store session, but I have no settings, as if you can use the session, you can use it.

7. Modify the extension = php_mysql.dll setting in php.ini, remove the ";" annotation mark. Because PHP5 does not load Mysql dynamic library

8. Modify the httpd.conf file under the confed directory under the Apache directory, modify the following

DirectoryIndex index.html index.html.val change to DirectoryIndex index.htm index.html index.html.val index.php default index

AddDefaultCharset ISO-8859-1 Change to AddDefaultCharset GB2312 Setting the default language to GB2312, if you are not Chinese, it doesn't matter

In the end of the file, add the following statement

### Increase the support for PHP5 Scriptalias / PHP / "C: / PHP /" AddType Application / X-httpd-php .phpaction application / x-httpd-php "/ php/php-cgi.exe"

If you need to do a virtual host, add the following statement at the end.

### Virtual host configuration NamevirtualHost *: 80

ServerAdmin webmaster@dummy-host.example.com DocumentRoot d: /WebRoot/www.webtechina.com ServerName www.webtechina.com ErrorLog logs / dummy-host.example.com-error_log CustomLog logs / dummy- Host.example.com-access_log common

The DocumentRoot property is used for the directory SERVERNAME stored by the specific website to respond to the main unit when the user adopts the corresponding URL address. After the above setting is completed. The virtual host does not use it normally to do the following settings% systemroot% / system32 / drvers / etc / host file Add as follows 127.0.0.1 www.webtechina.com9. Out of the above settings, you can restart the Apache's server.

10. After restart, you add a file index.php file in D: /www_root/www.webtechina.com directory: >

Then visit http://www.webtechina.com in the browser.

Finally, you can see your heart-moving PHP test page.

If you set a Host file, ping www.webtechina.co is not available, use the ipconfig / flushdns command in the CMD mode to be more than a few times.

转载请注明原文地址:https://www.9cbs.com/read-101883.html

New Post(0)