Build and use PHP development environment with custom installation

Source: Internet
Author: User
Tags apache php php development environment vc9

Today, I learned how to install Apache + PHP + MySQL + phpMyAdmin on my own. Next I will tell you the precautions for installation.

First,We recommend that you install it in the same folder during installation, so that it is easy to manage (the folder should not be Chinese)

1. Download Apache and install it.

2. DownloadPHP core package (for PHP Development Support), I download here: php-5.3.5-Win32-VC6-x86

Vc6 is compiled by the legacy Visual Studio 6 compiler. Vc9The Visual Studio 2008 compiler is compiled using Microsoft's vs editor.

 

So how do we choose which PHP version to download?
If you are using Apache + PHP in windows, select vc6;
If you are using IIS + PHP in windows, select vc9;

 

What is non thread safe?
Non thread safeIs non-thread security;
Thread safeWhat is?
Thread safe is thread security;
We do not recommend that you use non-thread safe in the production environment, so we use PHP of thread safe.

 

The installation of the PHP core package is to decompress the package.   3,How to integrate Apache and PHP (How to make Apache process PHP) ① In the conf directory of ApacheHttpd. confAdd the followingCode: # Load the Apache PHP processing module for PHP file configuration Loadmodule php5_module~ PHP installation path/Php5apache2_2.dll # Phpinidir is used to specify the php ini File Phpinidir"~ PHP module installation path" # This configuration indicates that PHP will handle a resource *. php. Addtype application/X-httpd-PHP. php. phtml Such as Configuration:

# Load the Apache PHP processing module for PHP file configuration
Loadmodule php5_moduleC:/myenv/php-5.3.5/Php5apache2_2.dll
# Phpinidir is used to specify the php ini File
Phpinidir"C:/myenv/php-5.3.5"
Addtype application/X-httpd-PHP. php. phtml

Note: we only need to change the red part to the actual PHP installation path.

② Why should I change the php. ini-development file to PhP. ini? Because our PHP settings need to bePHP. iniModify You can specify the corresponding functional modules in PHP. ini.

Open PHP. ini and find extension_dir and modify it. Here we need to specify the PHP extension LIBRARY PATH Extension_dir ="EXT"Modify the red part My installation path is as follows: extension_dir =" C:/myenv/php-5.3.5/EXT " Test whether the integration of Apache and PHP is successful Write such a piece of code and run <? PHP Phpinfo (); ?> Restart Apache 3. Install MySQL Here you need to customize the installation to the same directory as Apache and PHP. Next Write a PHP code to test whether it is successful!

<? PHP $ Conn = mysql_connect ("localhost", "root", "root "); If ($ conn ){ Echo "MySQL database connected "; } Else { Echo "failed to connect to Database "; } ?> The following error occurs during running: Fatal Error : Call to undefined function mysql_connect () in C: \ myenv \ apache \ htdocs \ test. php On Line 5 Cause:   Not Enabled currently MySQL Function , In PHP. ini Modifying

Extension = php_mysql.dll Extension = php_mysqli.dll 4. LastInstall phpMyAdmin (the website can actually better manage MySQL), which can be directly used

Decompress the package to the htdocs directory, and then you can directly access Now, you can configure the PHP environment on your own.

 

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.