Build a local PHP Environment

Source: Internet
Author: User

Building the php environment has always been a headache. I have been using xampp, an integrated development environment, and dw. I tried to configure the opportunity, but it was not successful. However, recently, the teacher took the time to teach us how to build a php environment. He had to set up and configure the environment on his head. There were a lot of problems in the middle, so he wrote a blog and took the right to take notes, what's more, it may be useful to create websites and projects for others in the future ..

 

From the net below software php-5.2.6-Win32 (decompressed version), apache_2.2.9-win32-x86-no_ssl-r2.msi, mysql-5.0.51a-win32, phpMyAdmin-v2.11.7. There is no need to talk nonsense about this step. Baidu or Google will just do it .. Install the software.

 Install and configure php5

 

1. Decompress php5 to a drive letter, for example, d: \ php5 .. The decompressed version is used here, saving installation trouble. Configure php ..

2. Copy the libmysql. dll file under the php5 directory to the windows/system32 directory on drive C, so that php supports mysql database extension.

Copy the php. ini-dist file under the php5 directory, rename it php. ini, and copy it to the windows directory of drive C.

3. Edit php. ini

Find:; extension = php_gd2.dll; extension = php_mbstring.dll; extension = php_mysql.dll; extension = php_mysqli.dll and remove the semicolon. enable extension. modify Register_global = Off TO Register_global = On and enable global variables... Extension_dir = "./"
To extension_dir = "d: \ php5 \ ext "...
4. Configure the environment variables my computer-> properties-> advanced-> environment variables-> system variables-> double-click to add

; D: \ php5 \ ext .. Do not ignore semicolons... Installation and configuration of apache 1. install apache, all the way to the next step, the next step will be done. 2. enter 127.0.0.1 in the address bar. The it works page appears, indicating that the installation is successful .. Configure .... 3. the configuration file is here :.. /apache/conf/https. find the following in conf: # LoadModule ssl_module modules/mod_ssl.so and add the following two lines to the end: LoadModule php5_module d:/php5/php5apache2_2.dll # PHPIniDir "d:/php5" (note the line feed) find AddType application/x-gzip. gz. tgz then adds the following two lines to the end: AddType application/x-httpd-php. php AddType application/x-httpd-php. html AddType application/x-httpd-php. inc (note line feed)

 

Find the following directory: DirectoryIndex index.html and add index. php default. php (do not wrap) to find documentroot and directory and change the path to "D:/webroot ". If you know a little about php, you will know that this is the root directory and path of php. Before that, you must create a webroot folder under the D Drive... Restart apache to make the changes take effect. Otherwise, the changes will be busy. Mysql installation and use of phpmyadmin are database and database management systems .. Mysql can also operate databases, such as creating databases, creating tables, deleting databases, deleting tables, and starting and stopping. However, the command is annoying after all, so you can use phpmyadmin for interface-based, very convenient ..... 1. Install mysql. You just need to go to the next step. There is nothing to say. Oh, don't forget to set the mysql password... 2. Decompress phpmyadmin to the root directory: d:/webroot... This is to let apache parse php code and pages... 3. Find/phpMyadmin/libraries/config. default. php and find the following lines for modification:

$ Cfg ['blowfish _ secret'] = 'dffdfd '; // password of the top secret phrase $ cfg ['servers'] [$ I] ['host'] = 'localhost '; // set your database server $ cfg ['servers'] [$ I] ['Port'] = ''; // server port, the default value is 3306 $ cfg ['servers'] [$ I] ['auth _ type'] = 'cooker '; // set it to cookie $ cfg ['servers'] [$ I] ['user'] = 'root '; // database Login User $ cfg ['servers'] [$ I] ['Password'] = '000000'; // save and modify the database login password... 4. Enter http: // localhost/phpmyadmin in the address bar to log on to phpmyadmin. After that, create a database and a table... Finally, I would like to say a few words to this environment. Here, php is a language, apache is an http server, which is used to parse php and return html code to the browser. mysql is a database and is responsible for storing data. Everything displayed on the front end depends on him .. Its commands also need to be known, very powerful, and sometimes used .. The environment has been configured, and apache is started at random. mysql is enabled all the time, and php is always powerful :). The following task is to create a site in dw to write code ....

 

 

 

 

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.