PHP configuration Summary

Source: Internet
Author: User

First, install PhP5 and decompress the file directly to c: \ PHP (it does not affect the installation. Based on your personal preferences, all the paths in this article are in my installation path, when installing Apache on your machine, you must change it to your own path.) then, install Apache. I directly install it in the C root directory. During the installation process, three text boxes are displayed. Enter your local IP address and your email address at the bottom. Installation is complete.
 
Edit the httpd. conf file under .. \ apache group \ apache2 \ conf. Open the file in notepad and add the following two lines in about 120 linesCode:
Loadmodule php5_module "C:/PHP/php5apache2. dll"
Addtype application/X-httpd-PHP. php

I created a WWW directory under the c: \ directory to store my site files, in httpd. conf finds the following sentence: DocumentRoot "C:/apache2/htdocs" changed to DocumentRoot "C:/www ". In this way, the home directory is set to c: \ www. If you do not want to change the home directory location, do not change this item.

Modify the default homepage of a directory:
Find the name of the file you want to set as the homepage after directoryindex, such as index.html index. php.

Language priority. Find the following statements.
Export agepriority ZH-cn zh-tw en ca CS da de El EO es et Fr he hr it Ja ko ltz nl nn no pl pt Pt-Br Ru SV set Chinese (zh-CN ZH -tw) cut the part to the Front (that is, change the corresponding part of the original file to the above.

There are no other changes. The configuration of Apach is here. Next, let's talk about the PHP configuration.

Put php5ts. dll under c: \ windows \ system32;

Copy PHP. ini-recommended to c: \ windows and change it to PhP. ini:

In data handling, locate post_max_size = 8 m
This is the maximum size of post data that PHP will accept, which can be changed to 20 mb.

Find extension_dir = under paths and directories
Here, the PHP search extension library location is set, and its path is set to the location of the extensions folder, that is, changed:
Extension_dir = "C: \ PHP \ Ext"

Under file uploads, find upload_max_filesize = 2 m, the maximum file size that can be uploaded
It can be changed to 20 mb.

Dynamic extensions is part of PHP extension settings. All extensions supported by PHP are listed. A semicolon comment is added before, indicating that the current PHP configuration does not support extension, we can remove the semicolon to allow PHP to support this extension. Below are a few common and useful PHP extensions listed below.
; Extension = php_mbstring.dll
; Extension = php_dba.dll
; Extension = php_dbase.dll
; Extension = php_filepro.dll
; Extension = php_gd2.dll
; Extension = php_imap.dll
; Extension = php_mysql.dll

The configuration of PHP. INI is complete. Next, it is very important
C: \ PHP \ libmysql. dll, c: \ PHP \ ext \ php_mysql.dll, c: \ PHP \ ext \ php_mysqli.dll
Copy to c: \ windows \ system32 so that PhP5 can support MySQL.
 

Restart Apache and create a new notepad file named test in the main directory.

<? PHP
Echo "I have made it! \ N ";
Echo "good luck! \ N ";
Phpinfo ();
?>

Save and modify the suffix to PhP. Enter http: // 127.0.0.1/test. php In the browser to see the PHP version information. Next, install MySQL.

Step 1: double-click the. exe file. The first dialog box to be selected is setup type, that is
Installation type. Here we can select Custom to install components and configure the installation path as needed.

Click Next, right-click the hard drive icon in the dialog box, and choose to install the component as needed,

Click the change button in the lower-right corner of the window to change the installation path. After setting the path, click Next to start installation.
The three options in the following dialog box are as follows:

1: If you do not have a mysql.com account, select the first account to create a new free mysql.com account.

2: If you have a mysql.com account, select the Second Account and enter the registered mailbox name and password.

3: skip this step

Select the first one.

Next, three dialog boxes are displayed. The "*" part in the three dialog boxes must be filled,
They are respectively the mailbox name, password, and confirm the password; first name, last name; zip code,
Country, Province name. Select China as the country name, and select other or N/A as the province name. Version 4.1.x and 4.0.x
One major difference is that after the installation is complete, winmysqladmin.exe is not running under the mysqlfolder.
After the server is started, you can set the options.

Step 2: Set MySQL

First, you will see a window with two options: detailed configuration and standard configuration,
Select the second option for a small application and click Next. The following dialog box appears. This is important and must be
Select mysql41 from the drop-down menu. Otherwise, the startup will fail. The following options are used to determine whether to apply the command line,
It is best to select the dialog box for setting the database password after clicking Next. The options in the middle right and below are:
Allow remote control and allow anonymous account login. For security reasons, do not select the option. Click Next to go out.
In the final dialog box, click the execute button to start the database server. After the four matches appear, click Finish to complete the installation.
Test:
Create a text document and edit it:
<? PHP
$ Link = mysql_connect ('localhost', 'root', '123 ');
If (! $ Link) echo "failed! ";
Else echo "successful! ";
Mysql_close ();
?>
Put it on the server and browse the file. If "Success!" is displayed !", MySQL is successfully installed.

The best tool to manage MySQL database is phpMyAdmin, now the latest version is phpMyAdmin 2.9.0.2, this is an international open source software, has been updated, you can download from the http://www.phpmyadmin.net official website, after installation, You can remotely update the database (which is actually installed on the server ).

For the installation method, see:

1. Download The phpMyAdmin installation package first.

2. decompress the package to a separate directory (you can customize the directory name)

3. Find the/libraries/config. Default. php file (the old version is the config. Inc. php file under the root directory) and edit it with a WordPad (do not use Notepad, this is utf8 encoding.

4. Search for $ cfg ['pmaabsoluteuri ']
Modify the phpMyAdmin URL that you will upload to the space
For local debugging, It is 'HTTP: // 127.0.0.1/PHPmyAdmin /'

5. Search for $ cfg ['servers'] [$ I] ['host'] = 'localhost'; (the default value is usually used, and there are exceptions. You do not need to modify the value)

6. find $ cfg ['servers'] [$ I] ['auth _ type'] = 'config ';
Debug config in your own machine. If you use cookies in the network space, now we have added the web site before, and then modify it to a cookie. We recommend that you use cookies here.

7. find $ cfg ['servers'] [$ I] ['user'] = 'root'; // MySQL user (user name, use root on your machine; this is generally your FTP user name on the Internet, which the VM provider will tell you. Do not change it)

8. find $ cfg ['servers'] [$ I] ['Password'] = ''; // MySQL password (only needed
Enter your MySQL password

10. find $ cfg ['defaultlang '] = 'zh'. (select the language. ZH indicates the meaning of Simplified Chinese)

Then browse "http: // 127.0.0.1/PHPmyAdmin/index. php", oh yeah! Test successful!

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.