thinkphp3.1 can't even connect to MySQL database please help

Source: Internet
Author: User
thinkphp3.1 can't even get a MySQL database. Please help me with the shrimp.
Thinkphp 3.1 can't even get a MySQL database please help me!!!

Project configuration file config.php:

Return Array (
' App_status ' = ' Debug ',
' Db_type ' = ' mysql ',//database type
' db_host ' = ' localhost ',//server address
' Db_name ' = ' thinkphp ',//database name
' Db_user ' = ' root ',//user name
' Db_pwd ' = ' 123456 ',//password
' Db_port ' = ' 3306 ',//Port
' Db_prefix ' = ' think_ ',//database table prefix
' Db_fieldtype_check ' = false,//whether field type checking is performed
' Db_fields_cache ' = = true,//enable field caching
' Db_charset ' = ' gb2312 ',//Database encoding defaults to UTF8
' Db_deploy_type ' + 0,//Database deployment method: 0 Centralized (single server), 1 distributed (Master-slave server)

' Db_rw_separate ' = false,//database read/write is separate master-slave valid
' Db_master_num ' + 1,//read/write separation of the number of servers
' Db_slave_no ' + ',//Specify the number from the server
' Db_sql_build_cache ' = false,//database query SQL Create cache
' Db_sql_build_queue ' + ' file ',//SQL cache queue cache mode support for file XCache and APC
' Db_sql_build_length ' =////SQL Cache Queue Length
' Db_sql_log ' = false,//SQL execution logging

);
?>

MySQL has a thinkphp database, THINK_ABC table with ID int primary key auto_increment,name varchar (), Age int,sex bool Field

Controller file IndexAction.class.php:

Class Indexaction extends Action {
Public Function index () {
$data =array (
' Name ' = ' dong ',
' Age ' =>21,
' Sex ' =>1
);
M (' ABC ')->add ($data);
}
}
?>

Browser display ' page error after browser input http://localhost/app/index.php, please try again later ' http://localhost/app/index.php/index/also tried ha In this case, the definition of other non-connected MySQL functions to run normal I have no way for beginners to get the expert guidance

------Solution--------------------
Delete the Runtime directory under the app and try again!

If you still can't, please call
  • 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.