Php environment configuration php5 MySQL5 apache2 phpmyadmin installation and configuration graphic tutorial

Source: Internet
Author: User
Tags blank page

Therefore, I wrote this configuration document specially and believe that you will succeed by following the steps below. I hope you will correct the error.
In this example, under wiondws XP
Php5.2.1 (zip)
Apache2.2.4
MySQL5.0.37
Phpmyadmin2.10.0.2
ZendOptimizer-3.2.6
Installation and configuration
Apache installation

1. Click the apahce installation package.
 

2 accept agreement


3. Enter the following three items as needed.
Apache listens to port 80. If iis uses port 80, modify the iis port or apache port to avoid conflict.


4. The default value is typical. click next.


5. You can modify the installation path here. Note that the installation path cannot contain Chinese characters.


6. Click install to start installation.


7. After the installation is complete, enter http: // localhost or http: // 127.0.0.1 in the browser.
If you can see this page, it proves that apache is successfully installed, you can already explain the static page.


MySQL Installation

1. Click MySQL installation package


2. The default value is Typical. If you want to modify the installation path, you can also select custom.
Note: The Path for installing mysql cannot contain Chinese characters!


3. Click intall to start installation.


4. Skip Registration


5. Do you want to configure MySQL now? You can also configure MySQL in the configuration wizard in the Start Menu.
Configuration now


6. Select Detailed Configuration (Detailed settings) and click Next to continue.


7. The following option selects the type that mysql applies to. The first option is development.Server,
We will only use as little memory as possible, and the second is a normal WEB server, which will use a moderate amount of memory,
The last one is that only MySQL databases are running on this server, which will occupy all the memory.
You can select an option based on your needs. Only the development server is selected here, and click Next to continue.


8. The following describes how to use the database. The first option is multi-function usage,
Optimize the database to a good innodb (transaction) storage type and an efficient myisam (non-transaction) storage type,
The second type is only used for transaction processing. innodb is the best optimized, but myisam is also supported. Only myisam supports full-text indexing.
The last is simple network development, which is suitable for simple applications. Only the myisam type that does not support transactions is supported.
Generally, select the first multi-function.


9 The following figure shows the data storage location of InnodDB, which is usually good by default and does not need to be changed.
(If You Want To modify the data storage path, you can also modify the datadir value of my. ini after installation)


10. Select the maximum number of connections allowed by MySQL. The first is the maximum number of concurrent connections,
The second option is a maximum of 500 concurrent connections, and the last option is custom. You can choose one based on your needs.
Select the first one.


11 The following figure shows whether to run the network link. Select the check box here. The database listening port. The default value is 3306,
If it is changed to another port, remember the modified port when connecting to the database. Otherwise, you cannot connect to the mysql database,
It is troublesome. Do not modify it here. Use the default port of mysq: 3306.


12 In this step, set the default mysql encoding. The default encoding is latin1, which is also the standard encoding. The second encoding is UTF8, and the third encoding is manual.
Encoding is introduced in Versions later than 4.1. If you want to use the data of the original database, you 'd better determine the encoding used by the original database. If the encoding is set here
The encoding is inconsistent with that of the original database data. garbled characters may occur during use. We recommend that you use latin1 standard encoding.


Of course, we can modify its encoding if necessary (not recommended ).


13. Whether to set mysql to a windows service in this step is generally set to a service,
In this way, you can enable and disable the mysql database through the service. We recommend that you select the check box below,
In cmd mode, you do not have to execute commands in the bin directory of mysql. You can run the command in command line mode to obtain the executable files.


14 this step sets the mysql Super User Password, which is very important to the Super User,
You have all permissions for mysql. Please set and remember the superuser password,
The check box below indicates creating an anonymous account, which will make the database system insecure.
If you have this requirement, check it.


15. Click Execute to install


16. Click finish to complete installation.


17. You can start using mysql. Open the mysql Command line Client of all programs in the Start menu and enter the password.
This interface indicates that mysql has been installed.


Possible problems:

If you are prompted in step 1

Because you have installed mysql before. Some configuration files are retained during uninstallation.

Click retry to see if it works. Otherwise, click cancel to exit. Then click MySQL Server Instance Config Wizard in the Start Menu.
Reconfigure mysql

Repeat the previous operation. Step 1 will show the interface as shown below

There are three places to enter the password. You have installed mysql.
Enter the original root password in the first text box, and enter the new root password in the next two text boxes.

If the problem persists, reinstall MySQL.
Note: It is best to delete all the original files. If necessary, clear the registry,
If there are no other mysql-related programs on your machine, do not keep the original my. ini file.
Delete the files in the original installation path and the ibdata1 files in the data directory.

More articles php enthusiast station http://www.phpfans.net

PHP installation

Php is a zip file (non-install Version), which is relatively simple to install.
Unzip it. Rename the extracted php-5.2.1-Win32 to php5. and copy it to the c directory. That is, the installation path is c: \ php5.

1. Find the php. ini. recommended (or php. ini-dist) file in the php Directory and rename it to php. ini.
And copy it to the windows directory of the system disk (take c: \ windows as an example ).

2. Copy php5ts. dll and libmysql. dll under the php Directory to the c: \ windows \ system32 directory.

3. Copy the php_gd2.dll, php_mysql.dll, and php_mbstring.dll files in the php5 \ ext directory to the c: \ windows \ system32 directory.
Note: Do not confuse php_mysql.dll with php_mssql.dll.
Php cannot process images if php_gd2.dll is not loaded. If php_mysql.dll is not loaded, php does not support mysql function libraries.
Php_mbstring.dll supports wide characters when phpmyadmin is followed.
More articles php enthusiast station http://www.phpfans.net

Install ZendOptimizer

Zend Optimizer improves the execution speed of PHP applications by optimizing code. The execution of the PHP program using Zend Optimizer is 40% to 100% faster than that without Zend Optimizer. In addition, Zend Optimizer must be installed to run some files encrypted with Zend SafeGuard.
Note: The installation of Zend Optimizer does not affect the normal operation of php. If you are in trouble, skip this step.

1. Click to install Zend Optimizer.


2. Accept the protocol and click next.


3. Select the installation path


4. Select the apache version. We use apache2.2.4. Therefore, select apache2.x.


5. Select the location of php. ini. In C: \ WINDOWS \,


6. Select the apache installation path. C: \ Program Files \ Apache Software Foundation \ Apache2.2.


7. Click install to install


8. Click Yes. The installer automatically completes configuration and server restart.


9. Click Finish to complete the installation.


After everything is installed, We can configure it again.

Configure php and associate MySQL

Open the c: \ windows \ php. ini file

The following content must be replied before you can see


1. Set the extension path
Find the row in extension_dir
Extension_dir = "./"
Change this row
Extension_dir = "C: \ php5 \ ext"
C: \ php5 is the path for installing php. dll cannot be loaded if the path is incorrect.
(Note: Some php versions are; extension_dir = "./" Remove the semicolon from the previous version)

2 search separately
; Extension = php_mbstring.dll
; Extension = php_gd2.dll
; Extension = php_mysql.dll
Remove the semicolon before the preceding three items so that these dll files can be loaded at apache startup.
Do not confuse extension = php_mysql.dl with extension = php_mssql.dl.
Of course, we copied these dll files to system32. (We noticed how to load some dll files during the installation process.
Some dll files, such as php_mysqli.dll, will be loaded later)

3. Set the session storage path.
Find the row in session. save_path.
; Session. save_path = "N;/path"
Add a row after this line (note that adding a row is not followed)
Session. save_path = "C: \ WINDOWS \ Temp"
Save it to your temporary directory, which can be saved to the windows temporary directory Temp.

4. Note the short_open_tag. Some php versions are Off by default.
That is to say, php cannot use short tags, as shown in <? ?> Required <? Php?>
Short tags are easy to use, and many programs use short tags for writing, such as discuz.
If you do not change short_open_tag to On, it will be difficult to determine the cause. We recommend that you modify it here.
Search
Short_open_tag = Off
Change
Short_open_tag = On

5. Whether the error display_errors is displayed
For security reasons, some display_errors versions are also Off by default.
That is to say, during debugging, if the php code is incorrect, only one blank page is displayed, and the error cause and number of lines are not displayed.
Therefore, debugging is inconvenient. You are advised to modify it as needed.
Search
Display_errors = Off (note not;-display_errors = Off [Security])
Change
Display_errors = On

6. display the NOTICE prompt
Although the error prompt is displayed in step 5, the error report is also controlled by error_reporting.
By default, NOTICE is disabled in php5. If debugging is performed locally, you are advised to enable the NOTICE prompt.
Search
Error_reporting = E_ALL &~ E_NOTICE
Change
Error_reporting = E_ALL

In addition, you can use error_reporting () to control the output of error reports. For details, refer to the following manual.

7 register_globals
It is also Off by default for security reasons.
When register_globals = Off, $ _ POST ['user _ name'] and $ _ POST ['user _ pass'] should be used for receiving the next program.
When register_globals = On, the next program can directly use $ user_name and $ user_pass to accept the value.
For more details, see
Http://www.phpfans.net/bbs/archiver? Tid-234.htm
We recommend that you modify the settings as needed. We do not recommend that you modify the settings here. After all, there are security risks.

8 php5 Time Difference
<? Php echo date ("Y-m-d H: I: s");?> Time Difference: eight hours
Why? The Time Zone settings are added for the PHP5 series. The default value is Greenwich Mean Time, which is 8 hours different from the East 8 zone in China.
Find the row in date. timezone
; Date. timezone =
Replace;
Date. timezone = PRC
PRC: People's Republic of China,
For more detailed solutions, refer to
Http://www.phpfans.net/bbs/archiver? Tid-60.html

For more information about File Upload configurations, see
Http://www.phpfans.net/bbs/viewthread.php? Tid = 1663 & extra = page % 3D1
More articles php enthusiast station http://www.phpfans.net

Integrate Apache with PHP

1. Open the apache configuration document from the Start Menu,


2. Modify the website root directory
Find that DocumentRoot has such a line
DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs"
This is the root directory of your website. You can modify it or use the default one. If you change it, you must modify the following one. Otherwise, the 403 error may occur.
Find This shoshould be changed to whatever you set DocumentRoot
There are two rows below it:
<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
Change the C:/Program Files/Apache Group/Apache2/htdocs of the preceding two items to the directory you want.

3. Find DirectoryIndex index.html.
Modify
DirectoryIndex index.html. var index. php
In this way, index. php can act as the default page.

4. modular installation of php in Apache
Find # LoadModule foo_module modules/mod_foo.so
Add a line after this line
LoadModule php5_module C:/php5/php5apache2_2.dll

(C:/php5/php5apache2_2.dll is the corresponding path for installing php.
Do not confuse php5apache2_2.dll, php5apache2. dll and php5apache. dll. php5apache. dll is only applicable to apache version 1.
Php5apache2. dll in the PHP5 compressed package is only applicable to apache2.0.*. If it is 2. 2. * or a later version, you must use php5apache2_2.dll. Otherwise, it may appear.
"Cannot load C:/php/php5apache2. dll into server: The specified module cocould not be found ."
Or:
"The requested operation has failed"
For details about how to solve this problem, refer to
Http://www.phpfans.net/bbs/viewt... & extra = page % 3D1
However, php5apache2_2.dll has little reference value)

5. Find AddType application/x-gzip. gz. tgz.
Add a line after this line
AddType application/x-httpd-php. php
In this way, apache can explain the PHP file.
Now the configuration is complete.

######## Restart apache. Click restart #########


Create a phpinfo. php file under the root directory of the website.

<? Php
Phpinfo ();
?>

Open in a browser
Http: // localhost/phpinfo. php
If the following information appears, it indicates that php has been configured.


Next, we will test the association between php and mysql databases.
Create a test. php file under the root directory of the website

[Copy to clipboard] CODE: <?Php
// Php fans station series tutorial [url] http://www.phpfans.net [/url]
$ Host="Localhost";
$ User="Root";
$ Password="12345";// Change 12345 to your mysql password
$ Link=Mysql_connect($ Host,$ User,$ Password);
If (!$ Link) Echo"<H1> failed! </H1>";
Else echo"<H1> successful! </H1>";
Mysql_close();
?>


Open http: // localhost/test. php In the browser
If the output is successful, it means the result is complete.


More articles php enthusiast station http://www.phpfans.net





Install phpMyAdmin

Download the phpMyAdmin-2.10.0.2-all-languages.zip, decompress it to the root directory of your website, and rename it phpMyAdmin,
Find and open libraries/config. default. php (some versions are config. inc. php or config. defaut. php in the current directory)
Make the following changes:

1. There are two rows for searching for the password:
$ Cfg ['servers'] [$ I] ['user'] = 'root ';
$ Cfg ['servers'] [$ I] ['Password'] = '';

Enter your mysql password in $ cfg ['servers'] [$ I] ['Password'] = ''.

2. Search for $ cfg ['pmaabsoluteuri '] and set the value in the single quotation marks to the phpMyAdmin directory path, for example, http: // localhost/phpMyAdmin /;

3 search $ cfg ['defaultlang '] and set the value in the single quotation marks to zh-gb2312;

The following code is modified based on your own needs (if you are not familiar with the database code, do not modify it)
4. Search for $ cfg ['defaultcharset'] and set it to the encoding you want.

Open the browser and enter http: // localhost/phpMyAdmin/. Apache and MySQL are started,
If the following page appears, phpmyadmin is installed and can be used.


Please familiarize yourself with the specific functions of phpMyAdmin.

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.