WINXP + Apache + PhP5 + MySQL + phpMyAdmin installation tips

Source: Internet
Author: User
Tags apache php sapi

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.

Phpinfo. phpCodeAs 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 as needed
find $ cfg ['servers'] [$ I] ['user'] = 'root '; modify as needed
find $ cfg ['servers'] [$ I] ['Password'] = ''; modify the settings as needed.
find $ cfg ['servers'] [$ I] ['Port'] = '20160301'. Modify the settings as needed.

Related Article

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.