Implement PHP5 Apache2 MySQL

xiaoxiao2021-03-06  18

Unzip php-5.0.0-win32.zip to D: / PHP to find php.ini-dist renamed PHP.INI in the PHP directory and copy it to the Windows directory (Win2k for Winnt) as mine PHP.INI is copy to the d: / windows directory again. PHP5TS.DLL in the HP directory, libmysql.dll is copied to the system directory (System / System32), if you are d: / windows / system

Configuring httpd.conf in apache to open d: /apache2/conf/httpd.conf This file is found to change it to AddDefaultCharset GB2312 (let the default language code to Simplified Chinese) find DocumentRoot "D: / Apache2 / HTDOCS "change it to your web directory (can not change), as my DocumentRoot" D: / Website "found DirectoryIndex index.html index.html.var Add index.htm index.php

Select Installation Mode: Modular mode installation or CGI mode installation (optionally)

Module Design Find #LoadModule SSL_Module Modules / MOD_SSL.SO this line, add a line loadModule php5_module d: /php/php5apache2.dll after this line where d: /php/php5apache2.dll is where PHP5apache2.dll is in your php directory Locate AddType Application / X-gzip .gz .tgz, add a line of addtype application / x-httpd-php .php after this line ------------------------------------------------------------------------------------------------------------ ------------------------------------------------

CGI design finds the line of addtype application / x-gzip .gz .tgz, add Scriptalias / PHP / "D: / PHP /" AddType Application / X-httpd-php .phpaction application / x-httpd-php "/ PHP / PHP-CGI.exe "------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -------------------------

At this point, the PHP environment is basically configured in the web root directory (such as my D: / Website) to build a file content called Test.php as shown below Restart Apache service Browser opens Http://localhost/test.php If you can see the PHP configuration output information is OK.

The second step is installed in Mysql (first-click, the configuration of this article does not apply to mysql4.1 and mysql5.0 version)

Install MySQL to the specified directory. If you are D: / mysql, if you download is the non-installed MySQL compression package, you can download it directly to the specified directory and then click D: /Mysql/bin/winmysqladmin.exe this file where D: / MySQL is your MySQL installation directory Entering Winmysqladmin initial user, password (Note: This is not MySQL user, password) Just fill no need to determine the launch bar of your lower right corner task, there will be a traffic light icon, red light Light of the representative service stop, green light is the service is normal if the green light is not executed: left click this icon -> Winnt-> Install the service Install this service to click this icon -> Winnt-> Start the service Launom Mysql service Modify mysql The database's root password is entered in the CMD to enter the list of commands: (Note: D: / mysql is mysql installation directory) CD D: / mysql / binmysqladmin -u root -p password 123456 Enter Password: (Note: This is called you to enter the original password. The password is empty when you just install it, so you will be transferred directly.) At this time, the password of the account root in mysql is changed to 123456 installation.

Third, configure php.ini and test mysql (php.ini is pHP.ini under Windows)

Found extension_dir = "./" changed to extension_dir = "d: / php / ext" found; extension = php_mysql.dll will ';' remove it to extension = php_mysql.dll; session.save_path = "/ tmp" ; 'Remove settings you save the session directory, such as session.save_path = "d: / php / session_temp";

Restart the Apache service In the web root directory (such as D: / Website) to establish TESTDB.PHP file content as follows: Open http://localhost/testdb.php by browser if the output Success is OK

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

New Post(0)