Windows Php,mysql,apache related installation and configuration, perfect ...

Source: Internet
Author: User
Tags echo date install php php and mysql phpinfo blank page phpmyadmin

installation of PHP

Because PHP is a zip file (not installed version), the installation is relatively simple
Unzip on the line. Rename the extracted php5.2.1-win32 to PHP5. and copy it to the installation disk directory. For example, the installation path is C:\PHP5
1?? Locate the Php.ini-dist or php.ini.recommended file in the PHP directory, rename it to PHP.ini, and copy it to the Windows directory of the system disk (C:\Windows for example, 2000 is in the Winnt directory, The following are used by netizens to explain the method).

2?? Then copy the Php5ts.dll,libmysql.dll in the PHP directory to the directory C:\Windows\System32.

3?? Copy the Php_gd2.dll,php_mysql.dll,php_mbstring.dll file under the Php5\ext directory to C:\Windows\System32
What if the Php_gd2.dll is not loaded?? PHP will not be able to process images. No load Php_mysql.dll PHP will not support the MySQL library Php_mbstring.dll support wide characters when using phpMyAdmin later
We'll configure everything after the installation is complete.

configuring PHP and associating MySQL
Open C:\windows\php.ini File
1 Setting the extension path
Find Extension_dir have this line
Extension_dir = "./"
Change this line to
Extension_dir = "C:\php5\ext"
Where C:\PHP5 is your path to install PHP. The path is incorrect and the DLL cannot be loaded
(Note: some PHP versions are; extension_dir = "./" To remove the preceding semicolon)

2 Find Extension
Extension=php_mbstring.dll
Extension=php_gd2.dll
Extension=php_mysql.dl
Remove the semicolon from the preceding 3 items so that the Apache can load the DLLs when it is started.
Of course, we also copied these DLLs to System32.

3 Setting the session save path
Find Session.save_path have this line
; ??? Session.save_path = "N;/path"
Add a row after this line (Note that you add a line, not add to the back)
Session.save_path = "C:\WINDOWS\Temp"
Saved to your temp directory, it can be saved to the Windows Temp directory Temp

4 It's worth noting that Short_open_tag is off by default.
In other words, PHP cannot use short tags such as <??> must use <?php?>
Because the short mark is easy to use, and many programs are written with just a few marks, such as discuz, etc.
If you do not change the Short_open_tag to on will appear the symptoms will be difficult to judge is the above reasons, it is recommended to modify
Find
Short_open_tag = Off
Switch
Short_open_tag = On

5 Display Error Display_errors
For security reasons, Display_errors also defaults to OFF
That is, when debugging, if the PHP code is wrong, only a blank page appears. It does not show the cause of the error and the number of rows that were faulted.
This will be very inconvenient to debug, it is recommended to modify according to your needs
Find
Display_errors = Off?? ?? ??? (Note not;-display_errors = Off??????? [Security])
Change into
Display_errors = On

6 register_globals
It is also off by default for security reasons
When Register_globals=off, the next program should receive the $_post[' user_name ' and $_post[' User_pass ']
When Register_globals=on, the next program can accept values directly using $user_name and $user_pass.
For more detailed instructions, please refer to
http://www.phpfans.net/bbs/archiver/?tid-234.htm
Suggestions to modify according to your needs

7 php5 Time difference problem
<?php echo Date ("y-m-d h:i:s");? > Time difference eight hours
Why is it? The PHP5 series has a new time zone setting, which defaults to GMT, which is 8 hours from the East 8 district in China.
Find Date.timezone have this line
;d Ate.timezone =
To remove, change, or convert to
Date.timezone = PRC
of which Prc:people's Republic of China,
For a more detailed solution, please refer to this forum
http://www.phpfans.net/bbs/archiver/?tid-60.html
Apache Integrated PHP

1 Open the Apache configuration document from the Start menu

2 Modifying the Web site root directory
Find DocumentRoot have this line
DocumentRoot "C:/Program Files/apache group/apache2/htdos"
This is the root of your site, you can modify, you can also use the default. If you change it, change the following, or you may get a 403 error
Find?? This should is changed to whatever the set DocumentRoot to
There are two lines below it
<directory "C:/Program files/apache Group/apache2/htdocs" >
Change the above two C:/Program Files/apache Group/apache2/htdos to the directory you want.

3 find?? DirectoryIndex index.html Index.html.var
Modified into
DirectoryIndex index.html Index.html.var?? index.php
This allows the index.php to act as a default page.

4 PHP Modular installation in Apache
Find # LoadModule Foo_module modules/mod_foo.so
Add a row after this line
LoadModule Php5_module C:/php5/php5apache2.dll

Where C:/php5/php5apache2.dll is the appropriate path for you to install PHP.
Be careful not to confuse Php5apache2.dll with Php5apache.dll. Php5apache.dll is only available for Apache version 1.
Note:The Php5apache2.dll in the PHP5 compression package is only available for apache2.0.* version, and if it is 2.2.* or later, it may appear
"Cannot load C:/php/php5apache2.dll into server:the specified module could isn't be found."
Or:
"The requested operation has failed"
. The solution to this problem can be referred to in this forum
http://www.phpfans.net/bbs/viewthread.php?tid=857&extra=page%3D1

5 Find AddType application/x-gzip. gz. tgz
Add a row after this line
AddType application/x-httpd-php. php
So Apache can explain PHP files.
The configuration is basically done here.

########Restart Apache#########

Create a phpinfo.php file in the root directory of the Web site

<?php
Phpinfo ();
?>

Open in Browser
http://localhost/phpinfo.php
If the following message appears, PHP is already configured


Then test the correlation between PHP and MySQL database
Create a test.php file in the root directory of the Web site

?

<? PHP
$link=mysql_connect("localhost","root","12345");?? //12345 changed to your MySQL password
if (! $link ) echo "Failed!"
else echo "Success!"
mysql_close ();
?>

Open http://localhost/test.php in Browser
If the output is successful, you are done.

Installing PhpMyAdmin

Download get phpmyadmin-2.7.0.zip, unzip it to your website root directory and rename it to PhpMyAdmin,
Locate and open config.defaut.php (some versions are config.inc.php or libraries/config.default.php)
Make the following changes:

1 Find password like next two lines
$cfg [' Servers '] [$i] [' user ']?? ?? = ' root ';???
$cfg [' Servers '] [$i] [' Password ']?? = ";

Fill in your MySQL password to $cfg[' Servers ' [$i] [' Password ']?? = "; Single quotes Inside

2 Search $cfg [' Pmaabsoluteuri '], set it to the PhpMyAdmin directory path, such as:http://localhost/phpMyAdmin/;

The following two items are modified according to the code you need (if you are not familiar with the database coding, do not modify the recommendations)
3 Search $cfg [' Defaultlang '], set it to zh-gb2312;
4 Search $cfg [' Defaultcharset '], set it to gb2312;

Open the browser and enter:http://localhost/phpMyAdmin/, both Apache and MySQL have been started,
If the following page appears, the phpMyAdmin installation is complete and you can use the

PhpMyAdmin the specific function, please slowly familiar, here no longer repeat.


php5.12+apache2.054+mysql5.0 Windows XP installation Notes

1. Installing Apache

?? Apache_2.0.54-win32-x86-no_ssl, very easy, all the way next is OK. After installation, open the \htdocs folder in the installation directory, modify any of the files in the suffix to HTM can be changed.

?? Open ithttp://localhostCheck if the installation was successful.

2, installation PHP5

?? Unzip the Php-5.1.2-win32 to directory to c:\php, and copy the Php5ts.dll under the directory to the C:\Windows directory.

Copy the following DLL files under the C:\PHP directory in the C:\windowssystem32 directory:
Fdftk.dll
Fribidi.dll
Gds32.dll
Libeay32.dll
Libintl-1.dll
Libmhash.dll
Libmysql.dll
Libmysqli.dll
Ntwdblib.dll
Ntwdblib.dll
Yaz.dll
Where Libmysql.dll is extended support for versions prior to MySQL 4.1, Libmysqli.dll is extended support for versions after MySQL 4.1. Because I download the above is the MySQL 4.0.20, so actually copy libmysql.dll can.
Copy the Php.ini-dist file under the C:\PHP directory into the C:\windows directory and rename it to PHP.ini, and open the edit with Notepad:
Navigate to the following two lines:
; Directory in which the loadable Extensions (modules) reside.
Extension_dir = "./"
Modify the following line to point to the C:\PHPext directory, modified as follows:
; Directory in which the loadable Extensions (modules) reside.
Extension_dir = "C:\PHP\ext"

The extension=php_mysql.dll of the front; remove.

3, modify the Apache directory httpd.conf file, navigate to the following line:
DirectoryIndex index.html Index.html.var
Add a PHP default page after it, usually index.php, as follows:
DirectoryIndex index.html Index.html.var index.php
In order for Apache to identify the associated extension for PHP, search for and navigate to this section:
<directory "C:/apache/apache2/cgi-bin" >
AllowOverride None
Options None
Order Allow,deny
Allow from all
</Directory>

Add the following two lines later:
AddType application/x-httpd-php. php. phtml. php3. PhP4
AddType Application/x-httpd-php-source. Phps
Specify the PHP module and locate and navigate to the following line:
#LoadModule Ssl_module modules/mod_ssl.so
Add a line below:

LoadModule Php5_module C:\PHP\php5apache2.dll
Make it point to the Php5apache2.dll file in the PHP5 directory, and the path must be accurate.
If you want to disable directory browsing, find and navigate to the following lines:

Options Indexes FollowSymLinks
Remove a few lines of comment below the line followed by the Indexes, modified:
Options FollowSymLinks

OK, re-start the Apache server after saving the httpd.conf file.

Write a PHP test file ~ok~!

3, install Mysql-5.0.0-alpha-win, all the way Next~~ok!

?

Reference: http://www.phpfans.net/

Windows Php,mysql,apache related installation and configuration, perfect ...

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.