Home >Backend Development >PHP Tutorial >PHP configuration experience includes MYSQL5 garbled solution_PHP tutorial

PHP configuration experience includes MYSQL5 garbled solution_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:00:25830browse

After a recent period of enthusiastic PHP programming, I have deep feelings about the configuration of PHP under the WINDOWS platform. At first, I used the one-click installation of the fool package. However, considering that the installation version of the fool package has fallen behind, I have to manually configure PHP. I encountered many problems when setting up the environment. After consulting a lot of information and trying, I finally configured it successfully. Now, I will share my configuration experience with you. I believe it can solve everyone's confusion about configuring the PHP environment.

First of all, let me talk about the software version I use.
PHP 5.1.6
APACHE 2.0.59 (Note: APACHE 2.2.X and above does not support PHP 5)
MYSQL 5.0.24a

Okay, now start the installation, I installed php5 first and unzipped the file directly to C:php (it will not affect where I install it. Depending on my personal preference, all paths in this article are based on my installation path. Please install it on your own machine. Pay attention to change it to your own path), and then install APACHE. I installed it directly to the root directory of drive C. During the installation process, 3 text boxes will appear. Enter your local IP in the top two and the bottom one. Your EMAIL, okay. Installation completed. Now edit the httpd.conf file under Apache GroupApache2conf. Open the file with Notepad and add these two lines of code at the end:
LoadModule php5_module "C:/php/php5apache2.dll"
AddType application/x-httpd-php .php

Me I created a www directory in the C: directory to store my site files. I found this sentence in httpd.conf: DocumentRoot "C:/Apache2/htdocs" was changed to DocumentRoot "C:/www". In this way, the home directory is set to C:www. If you don't want to change the home directory location, you don't need to change this.

Modify the default homepage of the directory:
Find DirectoryIndex and write the file name you want to set as the homepage, such as: index.html index.php, etc.

Language Priority, find the following statement
LanguagePriority zh-CN zh-TW en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv
Cut the Chinese (zh-CN zh-TW) part and put it in front (that is, change the corresponding
part in the original file to the above.

There is nothing else to change. That’s it for the configuration of APACH. Next, let’s talk about the configuration of PHP.

Copy php.ini-dist to C:windows and rename it to php.ini (anyone who has installed php has done this)
Then Several places have been modified:


Find post_max_size = 8M under Data Handling
This is the maximum size of POST data that PHP will accept, which can be changed to 20M in Paths. Find extension_dir=
under and Directories. What is set here is the location where PHP searches for extension libraries. Set its path to the location of the extensions folder, that is, change it to:
extension_dir= "C:phpext"

Find upload_max_filesize = 2M under File Uploads. The maximum file size allowed to be uploaded
can be changed to 20M.

Dynamic Extensions
Here is the PHP extension settings section, which lists all available PHP options. To support extensions, a semicolon note
is added in front, indicating that the current PHP configuration does not support extensions. We can remove the semicolon to allow PHP to support the extension
Listed below are several commonly used and more practical PHP Extension
Remove the semicolon in front of the following sentences
;extension=php_mbstring.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_imap.dll
;extension=php_mysql.dll

This is the end of php.ini configuration. Then the very important point is
C:PHPlibmysql.dll, C:PHPextphp_mysql.dll, C:PHPextphp_mysqli.dll
Copy to C:Windowssystem32 so that PHP5 can support MYSQL.

Restart APACHE, create a new notepad file test in the home directory and enter
phpinfo();
?>
Save and modify the suffix It's called PHP. Enter in browser

http://www.bkjia.com/PHPjc/317106.html

truehttp: //www.bkjia.com/PHPjc/317106.htmlTechArticleAfter a recent period of enthusiastic PHP programming, I have deep feelings about the configuration of PHP under the WINDOWS platform. At the beginning I am using the one-click installation fool package, but consider the installation version of the fool package...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn