Windows 7 + apache2.2 + php5.2 + mysql5.5 FAQs

Source: Internet
Author: User
Tags apache php

I. Apache cannot find the PHP Module

In httpd. conf, add:

Loadmodule php5_module E:/green/php-5.2.17-Win32-VC6-x86/php5apache2_2.dll # PHP installation path
Phpinidir E:/green/php-5.2.17-Win32-VC6-x86/PHP. ini # PHP configuration file path
Addtype application/X-httpd-PHP. php
Addtype application/X-httpd-PHP. htm

2. php cannot load and start MySQL Module

1. Problem Description
 
Today, MySQL in PHP is suddenly unavailable. The following error message is displayed:
 
Libmysql. dll not found, so this application failed to start Apache PHP
 
Startup: Unable to load dynamic library: C:/apachegroup/PhP5/EXT \ php_mysql.dll
 
Then, an error occurs when calling the MySQL function:
 
Fatal error: Call to undefined function: mysql_connect ()
 
Production read my system, PHP. INI has correctly configured extension_dir:
 
Extension_dir = "C:/apachegroup/PhP5/EXT"
 
Php_mysql.dll exists in extension_dir, but why cannot it be mounted.
 
2. cause of the problem
 
Google found that:
 
To load the DLL "php_mysql.dll", you must first load the base DLL "libmysql. dll,
 
Although the former is in the ext directory, it can be found.
 
Then the latter is not in the ext directory (even though he is still confused), and no system can find it.
 
3. There are two solutions:
 
1. Copy these DLL files to Windows.
 
2. Add the PHP root directory to the path.
 
 
Iii. coding problems

Encoding involves many aspects: (1) Client encoding. For example, you can right-click the browser and choose from the menu; (2) encoding used in the transfer process between the database client and the server; (3) encoding used for actual storage of the server database;

The most convenient way to deal with this process is to use utf8.

First, all server files, such as. html and. php, must be saved using utf8 encoding. Second, the database client sets utf8 before sending or receiving data, and the server uses utf8 encoding for database creation.

Life is so short that you don't need to focus on complicated code conversion unless you have to deal with the past and there are various coding systems. Let's embrace utf8!

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.