The PHP+APACHE+MYSQL environment constructs the course _php example

Source: Internet
Author: User
Tags apache download file copy mysql download php download php website

Php+apache+mysql Download
php Download:http://www.php.net into the PHP website after clicking download into the following interface. The above shows a different version of my choice is php5.6.19 version, this is more stable, if there is no version of the request recommended use of this version. Develop PHP in Windows environment, so continue clicking on the Windows downloads download package in the picture.


In the interface you can see the main VC11 X64 thread safe,vc11 X64 The None thread safe version, I chose VC11 X64 thread safe threaded zip compression package.


After downloading directly to the directory you want to place, remember must be with the next Apache installation package in the same directory, open folder can see the file, Where ext is stored after all dynamic link library files (. dll) because it is a compressed package, we also need to manually set up; there is no php.ini file in the original folder, you need to rename the Php.ini-development file in the package, because we need php.ini to carry out our set P HP initialization.


Apache Download:http://www.apachehaus.com/cgi-bin/download.plx this link to download the interface directly to the latest version of Apache, for the compatibility of the proposed choice of VC9 version, The specific difference on the Web page has an explanation and this is not to repeat.


Click on the red border of the download can then install the package, and then follow the prompts to install the line, Remember to install in the same directory with the PHP extract package

Next you need to configure the main Apache service, and with it, Apache can start:

Open the cmd window, enter : "D:studytools\apache\bin\httpd.exe"-K install-n Apache which d:studytools\apache\bin\ Httpd.exe is my own path, we need to change according to their own path.

Remember to include quotes. The command means to install the Apache service and name the service as Apache (you can also change it to something else) and enter.

Service installed, finished, will automatically test, if there is a problem, the window will be prompted to error, at this time, please follow the error of their own troubleshooting.

Among them, Errors reported here must is corrected before the service can be started. This means that if there is an error message after the sentence, the service installation fails and the error needs to be corrected first. If not, then success.

MySQL download installation steps too much, online tutorials very detailed, here omitted ...

However, small series for everyone to share a few articles for your reference:

MySQL 5.7.12 winx64 Installation configuration method graphics and text tutorial

MySQL 5.7.13 installation configuration method graphics and text tutorial (Linux)

MySQL 5.7.13 winx64 Installation configuration method graphics and text tutorial

Wonderful topic sharing: MySQL installation tutorials for different versions

Now start to build the environment of the three:
1. In order to enable PHP to connect with MySQL, Apache can parse PHP, we need to make some changes to the Php,apache.

(1) Change the php.ini-development file copy to php.ini in the original folder

(2) Again open php.ini file to find ; extension=php_mysql.dll; extension=php_mysqli.dll Remove front ";" The following figure


After removing the preceding semicolon, you can then connect to the database in MySQL or mysqli mode. In the future, when you want to use other such as PDO to connect to the database, you can follow the tutorial to cancel the following number of PDO. Next to find "extension_dir=" in the back of their own dynamic link Library folder path, that is,/php/ext like my PHP under the Ext package path is D:\studytools\php\ext so set to the following figure red box. So we give PHP contains the dynamic link library path, suggest the best in the computer environment variable in path also add ext path.


After that, there's no problem with PHP and the database.

Next, troubleshoot the Apache parsing PHP problem
1. Open the Apache installation package under the Conf folder httpd.conf file found in the Define srvroot "" In the letter to write the Apache path, and then add the following code to save the line

LoadModule php5_module "E:/wamp/php-5.6/php5apache2_4.dll"

<ifmodule mod_php5.c>

Phpinidir "e:/wamp/php-5.6/"

AddType application/x-httpd-php. php

AddType Application/x-httpd-php-source. Phps

</IfModule>

Whether the test was successful
Finally, you can start writing your own PHP files under Apache Htdocs folder, you can write a test.php file, content:

 <?php

  phpinof ();


 ? >

Save, open the ApacheMonitor.exe in the bin file under Apache, click Start, and then in the site input localhost/test.php environment, the following interface will appear. In the interface will have PHP information, if the MySQL connection is good, will also appear in the back of MySQL related information.


The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.