How to configure the apache mysql php environment

Source: Internet
Author: User

Windows:

We recommend that you do not install the software on the system disk. It can be the root directory or other directories, but it is best not to have spaces in the directory name to avoid some errors.

Configure Apache and PHP

Open the Apache configuration file httpd. conf (in the conf sub-folder under the Apache installation folder), find DocumentRoot "X:/xxx/htdocs" and <Directory "X: /xxx/htdocs "> (the quotation marks vary depending on the personal installation address). Change the quotation marks to the folder where the website is located. For example, here I change to DocumentRoot "E:/WEBSITE" and <Directory "E:/WEBSITE">

Tip: in Windows, the address is written as E: WEBSITEWEBSITE. In httpd. conf, the address is changed to E:/WEBSITE. The backslash (") is changed to slash "/"

Find LoadModule and add

LoadModule php Tutorial 5_module "D:/xampp/php/php5apache2_2.dll"
PHPIniDir "D:/Inetpub/PHP"

But it seems that xampp should not add either of them !!

For two lines of code, change the address in quotation marks based on the PHP installation position.

Find DirectoryIndex index.html and change it to DirectoryIndex index. php index.html.

Find AddType application/x-gzip. gz. tgz and add

AddType application/x-httpd-php. php
AddType application/x-httpd-php. html
Save httpd. conf

In the PHP installation folder, back up php. ini-recommended and rename it to php. ini to open php. ini.

Find; extension = php_bz2.dll. Below is a long list of similar modules that can be selected for loading. You can load them as needed by removing the previous number. For example, I have loaded:

Extension = php_gd2.dll
Extension = php_mysql tutorial. dll
Extension = php_xmlrpc.dll
Find memory_limit =. Modify the following values to limit the maximum memory size that php scripts can use.
Save php. ini

Add the PHP installation folder to the Windows system path. Specifically, choose computer> Properties> Advanced System Properties> environment variables> System variables> Path> Edit. Add D: xamppphp; D: xamppphpext to the variable values, the specific path is changed according to your own situation.

Test whether Apache and PHP are correctly installed.

Create a text file in the folder where your website is stored (for example, E: WEBSITEWEBSITE) and enter the following code:

<? Php
Phpinfo ();
?>

Save as index. php.

Then open the website http: // localhost/index. php in the browser. If the following figure is displayed, Apache and PHP are successfully installed.

Configure MySQL.

Select Detailed Configuration, that is, manual Detailed Configuration.

Then select Developer Machine, because we are working as a desktop server and used for development and debugging, so select this one.

Select the Multifunctional Database, which is the default one.

Set InnoDB Tablespace by default. If you adjust the settings, you must set them to the same for later reinstallation, otherwise the database tutorial will be damaged. Of course, back up the database and it will be okay.

Set the number of concurrent connections of the MySQL Server. Because it is a desktop Server, the default value is the first. You can also select the last one and enter the expected value.

Set the port and mode. The default value is enough.

Set the default database language encoding and select the second item UTF8.

Select the service and whether to add the MySQL installation directory to the system path.

Set the administrator password. If the installation is resumed after the system is reinstalled, do not check anything here.

After confirmation, the program is automatically configured and MySQL is enabled.

Install phpMyAdmin

Decompress phpMyAdmin to the desired folder, for example, D: xamppphpmyadmin, and then set config. default. copy php to The phpmyadmin folder and rename it config. inc. php.

Open config. inc. php and find

$ Cfg ['servers'] [$ I] ['auth _ type'] = 'config ';

Modify it

$ Cfg ['servers'] [$ I] ['auth _ type'] = 'http ';
Open the Apache configuration file httpd. conf, find # Alias/webpath/full/filesystem/path, and add the code below (the specific path is modified according to your own situation ):
Alias/phpmyadmin "D:/xampp/phpmyadmin"
<Directory "D:/xampp/phpmyadmin">
AllowOverride None
Options None
Order allow, deny
Allow from all
</Directory>
Save httpd. conf. Run httpd-k restart in the command prompt or restart Apache in the service.

Test whether MySQL and phpMyAdmin are correctly installed.

Open http: // localhost/phpmyadmin in the browser. In the displayed dialog box, enter the MySQL administrator account (root) and password.

If you log on successfully and open the phpMyAdmin interface, the installation of MySQL and phpMyAdmin is complete.

 

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.