Win7 Manual configuration Apache+php+mysql

Source: Internet
Author: User
Tags ini learn php php file php and php and mysql phpinfo win32 root directory

Originally wanted to learn PHP, so want to build a Web server and SQL environment, the result wasted a lot of time.

The general summary, also is a long memory.

The installation packages used are Httpd-2.2.22-win32-x86-no_ssl msi,php-5.2.5-win32.zip and Mysql-installer-community-5.5.28.3.msi, respectively. Obviously, it's a newer installation package. The installation of Apache is still relatively smooth, all the way installed, the default listener all IP 80 ports, of course, including loopback address, and then extract PHP to the designated folder, and then install MySQL, open the installation directory under the httpd.conf file, make the following adjustments:

ServerRoot "d:/apache2.2" Server installation root directory

DocumentRoot "D:/phpweb" modified to its own site root directory

# This should is changed to whatever your set DocumentRoot to.

<directory "D:/phpweb" > synchronized with the previous step

# directoryindex:sets The file that Apache would serve if directory a

# is requested.

<ifmodule dir_module> Set the default requested file

DirectoryIndex index.php index.html

</IfModule>

LoadModule php5_module "D:/php/php5apache2_2.dll" loads PHP in a modular way, noting that the php5apache2_2.dll corresponding Apache version here

LoadFile "D:/php/php5ts.dll" Manually load the PHP dynamic link library or put these two files in the System32 file directory

LoadFile "D:/php/libmysql.dll" Loading MySQL dynamic link library

Phpinidir "d:/php" non-essential configuration

AddType application/x-httpd-php. php. html. htm server-side support for dynamic file types

After saving the changes, test Apache, restart the Apache server, enter the localhost or loopback address in the browser, and the page displays "It works!" To this note, Apache has worked.

Test PHP, in the Phpweb directory to edit a index.php file, the content of <?php phpinfo (), repeat the test Apache server operation, the page display PHP configuration information, see whether the SQL module, I would like to not, Because PHP does not load the MySQL module by default. Then modify the php.ini file, the main change points are as follows:

Extension_dir = "D:/php/ext" extends the location of DLL libraries

......

Extension=php_mysql.dll to open MySQL extensions

For php.ini modification is quite depressed, the internet looked for a lot also made a variety of changes, indefinitely to try, then did not work. Consider whether MySQL is installed successfully, start using the command line to view, first look at Port 3306 port is listening, using the Netstat-a command, and then use the MySQL Workbench test connection with the database is successful, the results of the successful description of MySQL installation is not a problem, MySQL configuration file is My.ini, temporarily do not move, the default configuration can work. So the problem is in PHP and MySQL interface, the problem is certainly in the php.ini file.

Open check php.ini, or first look at phpinfo () give the information, it seems to see how there is no MySQL module, began to doubt whether I opened the configuration information in the MySQL extension. God, opened unexpectedly is extension=php_mssql.dll. There are no digits omitted here.

Wahtever, the problem finally found, testing, instantaneous OK, want to cry without tears. But looking back at the whole process, time is largely wasted on small mistakes. Summing up the lesson: face the problem without asking Baidu Google behind closed doors, but also can not blindly blind obedience; Facing the problem more is the continuous attention to the question, oneself analyzes the question.

The next step is a detailed analysis of the httpd.conf php.ini My.ini, flexible configuration, and performance tuning of the Web server and database server, and then porting the Web site to the newly rising Nginx Web server. Seems a bit off, of course, the main purpose is to learn the lovely PHP.

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.