WinXP + Apache + PHP5 + MySQL + phpMyAdmin installation tips

Source: Internet
Author: User
Tags apache php

I finally got this to work, so I will post my findings here.

// PHP 5: Windows build needs a MySQL DLL
// PHP 5.0 doesn' t come with mysql support... You have to get the librariesyourself...
// I think u can get them from mysql.com

// PHP 5 Beta 2
// The file php_mysql.dll comes with these snapshots, as well as a new version of libmySQL. dll,
// So I suggest a full upgrade to Beta 2 instead of just extracting php_mysql.dll for use with Beta 1.

--------------------------------------------------------
Download the following three types of software from www.jetdown.com and prepare for installation.

Apache_2.0.47-win32-x86-no_ssl.msi
Mysql-4.0.14-win.zip
PhpMyAdmin-2.5.3-rc1-php.zip
Bytes ----------------------------------------------------------------------------------------------
PHP 5 Beta 2 http://snaps.php.net/win32/php5-win32-latest.zip size: 5.87 MB (6,162,835 bytes)
Bytes ----------------------------------------------------------------------------------------------

<1> install and configure PHP
1. decompress the PHP compressed package to C: \ php \

2. Copy all php4ts. dll files in the C: \ php \ directory and all files in the C: \ php \ dlls directory to the system folder in the windows installation directory.
(Win9x/me is the system directory, winNT, 2 k/winXP, 2003 is the system32 directory)

Copy C: \ php. ini-dist to the windows Installation Directory (for example, c: \ windows) and rename it php. ini. Open it in notepad and modify the following information:
Search the extension_dir =./line and point its path to the extensions directory under your PHP Directory, for example:
Extension_dir = C: \ php \ extensions

To support more modules, search:
Windows Extensions
; Note that MySQL and ODBC support is now built in, so no dll is needed for it.

The following sections describe the supported extension modules with semicolons. If you want PHP to support a certain module, remove the preceding ";".
After the modification, save php. ini and install and configure PHP.
Add a line below
Extension = php_mysql.dll

// Note 1: The extension dir need not be ". \", as Hermawan mentioned. It works fine for me with the extensions subdir where the other extensions are located.

// Note 2: The php. ini file need not be in the Apache root, as lars mentioned. It works fine for me in the Windows dir.

<2> install Apach2
1. Back up the C: \ Program Files \ Apache Group \ Apache2 \ conf \ httpd. conf file.
2. use NotePad to Open C: \ Program Files \ Apache Group \ Apache2 \ conf \ httpd. conf
Find:
# NameVirtualHost *
To:
NameVirtualHost 127.0.0.1 // or localhost
Find:
<VirtualHost 127.0.0.1>
Modify the following lines:
ServerAdmin (the Administrator mailbox you entered during installation)
DocumentRoot C: \ Program Files \ Apache Group \ Apache2 \ htdocs
ServerName Apache2
ErrorLog C: \ Program Files \ Apache Group \ Apache2 \ logs \ error_log
CustomLog C: \ Program Files \ Apache Group \ Apache2 \ logs \ access_log common
</VirtualHost>
Find:
AddType application/x-tar. tgz
Add the following two lines below:
AddType application/x-httpd-php. php
AddType image/x-icon. ico
Find:
# LoadModule ssl_module modules/mod_ssl.so
Add a row below:
LoadModule php5_module C: \ php \ sapi \ php4apache2. dll // php5_module is the key here. If php4_module apache cannot be started
Add default files:
Find the DirectoryIndex * line. You can add the default file name as follows:
DirectoryIndex index. php default. php index.htm index.html default.htm default.html
Save the file and restart the apache server.

Finally, add the following two lines at the end of the file.
ScriptAlias/php/"c:/php /"
Action application/x-httpd-php "/php/php.exe"

By now, the Apache PHP environment has been fully established.

<3> test:
Create a file in notepad, write down the following lines, and save them to the C: \ Program Files \ Apache Group \ Apache2 \ htdocs Directory, which is your site and directory, name it phpinfo. php. enter http: // localhost/phpinfo in the browser. php will be able to see as much information as possible about PHP.

The phpinfo. php code is as follows:
<? Php

Phpinfo ();

?>

<4> install mysql

1. install it in C: \ mysql by default

Copy the following files to the Apache modules directory:

Php \ php4ts. dll
Php \ sapi \ php4apache2. dll
Php \ dlls \ iconv. dll

If any of these files are missing in the modules directory, Apache will fail to start.

Be sure the extension can find the following files:

Php_mysql.dll
Iconv. dll
LibmySQL. dll

If any of them can't be found, Apache will start but will issue a warning like this: "Unknown (): unable to load dynamic library 'C \ php \ extensions \ php_mysql.dll "-The specified module cocould not be found."

Php_mysql.dll shocould be in the extensions directory.

Iconv. dll shocould be in the Apache modules directory.

LibmySQL. dll must be either in the Apache root directory or the Windows system directory. I prefer the former because it's cleaner, as other applications don't necessarily use this MySQL library version.

Note 3: Be sure to use the libmySQL. dll file bundled with PHP. in my case, trying to use the libmySQL. dll from the MySQL 4.1 alpha package resulted in this error message: "Unknown (): Unable to load dynamic library 'C: \ php \ extensions \ php_mysql.dll "-The specified procedure cocould not be found."

Start Apache and everything shocould be fine.

2. Run C: \ mysql \ bin \ winmysqladmin.exe to set the user and password
3. Run mysql and test it.
Mysql> show databases;

+ ----------- +
| Databases |
+ ----------- +
| Mysql |
| Test |
+ ----------- +

If the preceding figure is displayed, mysql is successfully installed;

2. Change the password of the MySQL System Administrator (the password of the new password is the password you want to set)
Mysql> UPDATE user SET password = password ('new password secret') where user = 'root ';

3. Edit the Startup File php. ini in php5 and connect mysql and php5.
Mysql. default_port =
Mysql. default_host =
Mysql. default_user =
Mysql. default_password =
Changed:
Mysql. default_port = 3306 indicates that the default port of mysql is 3306.
Mysql. default_host = localhost indicates the default Host Name of mysql.
Mysql. default_user = jinchao indicates the default username of mysql (root is the highest level user)
Mysql. default_password = 666666 set the Administrator Password

After modification, restart apache to view the phpinfo page.

<5> install phpmyadmin

Modify C: \ Program Files \ Apache Group \ Apache2 \ htdocs \ phpMyAdmin \ config. inc. php
Find the following section:
$ I = 0;
// The $ cfg ['servers'] array starts with $ cfg ['servers'] [1]. Do not use $ cfg ['servers'] [0].
// You can disable a server config entry by setting host ''.
Continue searching after this section:

Find $ cfg ['servers'] [$ I] ['auth _ type'] = 'cooker'; Change "config" to "cookie" or "http 』
Find $ cfg ['servers'] [$ I] ['host'] = 'localhost'. Modify the settings as needed.
Find $ cfg ['servers'] [$ I] ['user'] = 'root', and modify it as needed.
Find $ cfg ['servers'] [$ I] ['Password'] = '', and modify it as needed.
Find $ cfg ['servers'] [$ I] ['Port'] = '000000', and modify it as needed.

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.