Note the configuration required for WAPM to run ThinkPHP-fan-Lin

Source: Internet
Author: User
Note: the configuration required to set up WAPM to run ThinkPHP-fan-Lin recently came into contact with Thinkphp due to the project and is in the hands. However, when I encountered several problems yesterday, I was suddenly implicated in the configuration issues left behind by building WAPM (windows + apache + PHP + MySQL.

In the directory of aphache \ conf, there are several things that need to be changed based on the principle of "less than never abuse": (but this still does not solve the problem above)

ServerRoot "d:/WAMP/Apache24"
     AllowOverride All    Require all deniedDocumentRoot "d:/WAMP/web"
 
      Options Indexes FollowSymLinks    AllowOverride All    Require all granted
 
 
      DirectoryIndex index.php index.html
 LoadModule php5_module "D:/WAMP/php/php5apache2_4.dll"AddType application/x-httpd-php .php .html .htmPHPIniDir "D:/WAMP/php"

Replace the specific path.

Mysql configuration:

Path: add environment variable path:; D: \ WAMP \ MySql55 \ bin do not overwrite the original computer.

Well, the key point is the php configuration. As shown in the figure, this class is not defined. First, locate this statement (because this is the developer mode, it will display a specific path)

(I'm hungry)

If (! Empty ($ config ['charset']) {// compatible with various versions of PHP. you can set the encoding in two ways: $ this-> options [\ PDO :: MYSQL_ATTR_INIT_COMMAND] = 'set names '. $ config ['charset']; $ dsn. = '; charset = '. $ config ['charset'];}

The key error points are:

\PDO::MYSQL_ATTR_INIT_COMMAND

This is thinkphp's method of calling third-party class libraries. if it is supposed to be executed normally in the tp framework, the problem should come from the commands in the PDO Library in php, I found that I did not enable the module supported by MYSQL in php. Open php. ini

Set

; Extension = php_pdo_mysql.dll

Uncomment

Extension = php_pdo_mysql.dll

After saving the modification, I ran php.exe and found that the module could not be found... re-checked and found that there was another path to be modified.

; Directory in which the loadable extensions (modules) reside.; http://php.net/extension-dir; extension_dir = "./"; On windows: extension_dir = "D:\WAMP\php\ext"

After modification, the problem is solved.

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.