Windows Server (R2) configuration Apache+php+mysql Environmental issues

Source: Internet
Author: User
Tags php website

Server environment:
Windows R2 64-bit. The apache,mysql,php are all 32 bits.

1.80-Port Extranet access issues

Performance: 80 port local access, external network can not access, changed 8080 port is also the same, checked and no other programs occupy this
Two ports.

Cause analysis: No 80 ports are configured in the firewall or Apache is not enabled for extranet access.

workaround : Add port 80 to both inbound and outbound rules for the firewall. Modify httpd.conf, find Deny from all,
Change to allow from all.

2. Unable to execute PHP

Reason analysis 1:apache not loaded PHP5 module

workaround : Modify httpd.conf, find #loadmodule vhost_alias_module modules/mod_vhost_alias.so,
Under it, add:

12 LoadModule php5_module "D:/php/php5apache2_2.dll"PHPIniDir "D:/php"

Note Modify the PHP path to the next.

Cause analysis 2:apache does not recognize PHP files

workaround : Modify httpd.conf, add

1 AddType application/x-httpd-php .php

3. Apache does not start properly

Performance: Command line launch Apache will error: Can not load D:/php/php5apache2_2.dll into server.

Cause Analysis: 1. The DLL does not exist; 2. The Visual C + + Runtime is missing.

Workaround :

For reason 1: Verify that the DLL file exists in the PHP directory. If not, to the official PHP website to download the full package, I use is
5.3.27 a non-thread-safe zip package, not an MSI.

For reason 2: Install Visual C + + Runtime library 2008. Note must be version 2008, for the sake of insurance I'm in
Both 64-bit and 32-bit editions are installed on 64-bit servers.

4. index.php default does not execute

workaround : Modify httpd.conf, find DirectoryIndex, add index.php in front of index.html

5. The MySQL database is not connected

There are many reasons for not connecting to the database, possibly database configuration problems, incorrect username and password, firewall port restrictions, and so on.

However, if you confirm that the database is functioning correctly, the username and password database name is correct and the database port is not in the firewall code (if the local database is not
With this in mind, these are normal but still not connected to the database, and the reason is probably that MySQL is not properly configured in PHP.

workaround : Modify php.ini and httpd.conf.

1. Modify httpd.conf, locate LoadModule php5_module, and add a line below it:

1 PHPIniDir "D:/php"

Note Modify the next PHP path.

2. Modify the php.ini. First of all your PHP directory if there is no php.ini, only php.ini.development and Php.ini.production,
A copy of the php.ini.production, and named PHP.ini.

Open the php.ini and make sure that the Extension_dir is properly configured as follows:

1 extension_dir = "C:/php/ext"

PHP directory changed to its own. Note that using a relative path is not a good way to use absolute paths, or full paths.

Next, remove the semicolon in front of the following two lines

12 ;extension=php_mysql.dll;extension=php_mysqli.dll

It should be like this after the change.

12 extension=php_mysql.dllextension=php_mysqli.dll

Save and restart Apache.

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.