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.