PHP Environment Construction

Source: Internet
Author: User
Tags vc9
Nowadays, it is very popular to use dream weaving and empire for websites, so I want to learn these two website creation templates. After checking the Internet, both of them are written in php, And the generated website is php + mysql. Learn the two templates without patience. Php environment construction; 1, need to download a few things: Apachehttpd-2.2.22-win32-x86-openssl-0.9.8t.msiP

Nowadays, it is very popular to use dream weaving and empire for websites, so I want to learn these two website creation templates. After checking the Internet, both of them are written in php, And the generated website is php + mysql. Learn the two templates without patience. Php environment construction; 1, need to download a few things: Apachehttpd-2.2.22-win32-x86-openssl-0.9.8t.msi P

Nowadays, it is very popular to use dream weaving and empire for websites, so I want to learn these two website creation templates. After checking the Internet, both of them are written in php, And the generated website is php + mysql. Learn the two templates without patience.

Php environment construction;

1. Download a few things:

Apache httpd-2.2.22-win32-x86-openssl-0.9.8t.msi

PHP php-5.3.10-Win32-VC9-x86.zip

Mysql http://www.mysql.com/downloads/

Click to download;

PHPEclipse Php IDE because eclipse has been installed on my computer, I chose PHPEclipse for convenience, and there are many download addresses online;

Http://www.oschina.net/p/phpeclipse

I have selected the Mysql graphics management tool, phpmyadmin

2. PHPEclipse decompress the downloaded file, copy the decompressed file to overwrite the Eclipse installation directory, and restart Eclipse to create a php project.

3. install apache;

4. You only need to extract Php files to a directory (which is better than apache in the same directory ).

5. Mysql installation can refer to (http://www.jb51.net/article/23876.htm ).

6. After these three configurations are installed, various configurations are required.

A. Apache:

First, modify the Apache configuration file so that Apache can parse the PHP file. The Apache configuration file is httpd. conf In the conf directory of the Apache installation directory. You can also choose Start> program> Apache http server. The "#" in the file is the annotator.

1. Apache can parse the PHP file and find it in the configuration file.

# LoadModule vhost_alias_module modules/mod_vhost_alias.so

Add in the next line (the red location is specified in the tutorial PHP Directory, that is, php-5.3.10-win32-vc9-x86.zip

Directory for file extraction)

LoadModule php5_module "D:/Develop/PHP/php5apache2_2.dll"
PHPIniDir "D:/Develop/PHP"
AddType application/x-httpd-php. php. html. htm

2. Find

Change DirectoryIndex index.html

DirectoryIndex index. php index.html

3. Modify the directory of the Apache site and find it in the configuration file (the directory for Apache installation is different and the displayed value is different)

Change DocumentRoot "D:/Develop/Apache2.2/htdocs" to the apach installation directory (D:/Develop/Apache2.2 ).

DocumentRoot "D:/Workspace/PHP"

      

Find

Change

  

NOTE: If apache cannot be started normally after installation, you can view the "Application log". Generally, port 80 is occupied.

Determine who occupies port 80.

1. Windows Platform

Run the following command in the windows command line window:

C: \> netstat-aon | findstr "80"

TCP 127.0.0.1: 80 0.0.0.0: 0 LISTENING 2448

As you can see, the port is occupied by a process with the process number 2448. Continue to execute the following command:

C: \> tasklist | findstr "2448"

Thread.exe 2016 Console 0 16,064 K

Well, thread occupies your port and Kill it.

If you do not want to kill the process that uses port 80, you can modify the default port of apache.

It is also modified in the httpd. conf file under the conf directory of the Apache installation directory,

Find "Listen80", and the number of Listen is the port number. We will change it to "Listen 8088". You can use the following method to check whether the modified port number is also occupied. Save and restart Apache.

B. php configuration

Find the directory for extracting the php-5.3.10-win32-vc9-x86.zip file and change php. ini-development to php. ini as the PHP configuration file. Modify php. ini. ";" Semicolon (annotator in this file)

(The Red location is specified in the tutorial PHP Directory, that is, the directory for extracting the php-5.3.10-win32-vc9-x86.zip file)

1. Set the directory of the PHP extension package and find

; On windows:
; Extension_dir = "ext"

(The value is the ext folder, which is the directory in phpk and contains important dll files of php .)

; On windows:
Extension_dir = "D:/Develop/PHP/ext"

(Note that the preceding ";" is removed)

2. Enable the corresponding library function and find the row of the library to be enabled

; Extension = php_curl.dll

; Extension = php_gd2.dll

; Extension = php_mbstring.dll

; Extension = php_mysql.dll

; Extension = php_xmlrpc.dll

Remove the semicolon (comment) and change it

Extension = php_curl.dll

Extension = php_gd2.dll

Extension = php_mbstring.dll

Extension = php_mysql.dll

Extension = php_xmlrpc.dll

      

3. Set the time zone and find

; Date. timezone = changed

Date. timezone = Asia/Shanghai

Note: after these configurations, restart apache .. When searching, you can use the search function in the text of the error message.

Failed to test the configuration.

Site Directory. D: In the/Workspace/PHP Directory, change the extension name of the new text file to. php to open and add the following content:

Phpinfo ();

// You can write your first php holle word! .

// Echo "Hello World ";
?>

Open the browser and enter http: // localhost (: 8088). If the default port number is 80, you can leave the port number Unspecified. If you modify the default port number, add the port number. If the following content is displayed, the configuration is successful.

C. Configure phpMyAdmin.

Preparations:

In the site directory, create a folder named phpmyadmin.pdf and unzip the phpmyadmin-2.7.0-pl2.tar.gz file to the folder you just created.

Add the mysql environment variable: add the mysql installation directory bin to the environment variable, E: \ mysql \ MySQL Server 5.6 \ bin

Cmd open the dos window, enter mysql-u root-p to add the car, and prompt to enter the password. View the database in mysql. Run the show databases command. Exit.

Find the config. default. PHP file in the "D:/Workspace/PHP/phpmyadmin" directory. Open it in notepad;

Find $ cfg ['blowfish _ secret'] = ''and change its value to any character you want, for example, $ cfg ['blowfish _ secret'] = 'suiyi ';

Find $ cfg ['servers'] [$ I] ['auth _ type'] = 'config ', change to $ cfg ['servers'] [$ I] ['auth _ type'] = 'cooker ';

Find $ cfg ['defaultlang '] = 'en-iso-8859-1' and change to $ cfg ['defaultlang '] = 'zh-UTF-8 ';

Find $ cfg ['defaultcharset'] = 'iso-8859-1 'and change it to $ cfg ['defaultcharset'] = 'zh-UTF-8 ';

$ Cfg ['pmaabsoluteuri '] = 'HTTP: // your domain name (localhost: 8088)/phpmyadmin/'; (phpmyadmin is the phpmyadmin folder .)

$ Cfg ['servers'] [$ I] ['host'] = 'database host address'; Local localhost

$ Cfg ['servers'] [$ I] ['user'] = 'site id'; root

$ Cfg ['servers'] [$ I] ['Password'] = 'Password'; root password set during mysql Database Installation

$ Cfg ['servers'] [$ I] ['only _ db'] = 'database name (site ID) '; mysql queries existing data.

Save. You can test it. Mysql services must be started.

Enter the address: http: // local: 8088/phpmyadmin in the browser and press enter to see the following page.

The configuration is successful.

Enter the password and log on to the mysql database.

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.