About WordPress configuration wp-config.php

Source: Internet
Author: User
By default, installing WordPress does not have a wp-config.php file, but a sample file called a wp-config-sample.php. You need to create a real profile wp-config.php for your blog based on this sample file. Most people will not manually create this real configuration file, because the WordPress installation process will allow you to automatically complete this process: the configuration of WordPress wp-config.phpWordPress the important file for the whole site is that the wp-config.php installed WordPress by default does not have a wp-config.php file, but a sample file called a wp-config-sample.php. You need to create a real profile wp-config.php for your blog based on this sample file. Most people will not manually create this real configuration file, because the WordPress installation process will allow you to automatically complete this process, this automatic creation process actually adds and modifies the main WordPress configuration. Database connection problems:Define ('Db _ name', 'database-name'); database NAME define ('Db _ user', 'database-username '); database username define ('Db _ password', 'database-password'); database PASSWORD define ('Db _ host', 'localhost'); database location, by default, the database host is localhost, which can be changed if you want to use another independent database. $ Table_prefix = 'WP _ '; database prefix
Security keys:The WordPress security key is a string of random variables, which can improve the encryption of information stored in cookies. For versions earlier than WordPress 3.0, you need to add them manually in the wp-config.php file. In WordPress 3.0 you automatically add security keys to your wp-config.php files. In versions earlier than WordPress 3.0, there are only four security keys, and WordPress3.0 has eight security keys. Define ('auth _ key', 'Put your unique phrase here '); define ('secure _ AUTH_KEY', 'Put your unique phrase here '); define ('logged _ IN_KEY ', 'Put your unique phrase here'); define ('nonce _ key', 'Put your unique phrase here '); define ('auth _ SALT ', 'Put your unique phrase here'); define ('secure _ AUTH_SALT ', 'Put your unique phrase here '); define ('logged _ IN_SALT ', 'Put your unique phrase here'); define ('nonce _ salt', 'Put your unique phrase here ');
WordPress debugging:For developers, WordPress has a very good debugging function, through which you can find errors. By default, this function is set to false. if it is used by developers, this function should be enabled. Define ('WP _ debug', false); // disable DEBUG define ('WP _ debug', true) by default; // enable DEBUG mode
Blog/website address:Define ('WP _ home', 'http: // www.lostphp.com '); define ('WP _ SITEURL', 'http: // www.lostphp.com ');
Overwrite File permissions:Define ('fs _ CHMOD_FILE ', 0755); define ('fs _ CHMOD_DIR', 0644 );
Automatically save configuration:Define ('autosave _ INTERVAL ', 120); // The unit of INTERVAL seconds is define ('WP _ POST_REVISIONS', 5 ); // define ('WP _ POST_REVISIONS ', false) the number of versions for each article; // This function can be used to disable automatic saving.
WordPress waste bin function:Define ('empty _ TRASH_DAYS ', 7); // use the integer code to automatically clear define ('empty _ TRASH_DAYS', 0) every other day; // cancel this function
Automatic Database optimization:Define ('WP _ ALLOW_REPAIR ', true); // true: after activating the database optimization, you can see its settings at the following address. Because it is mainly used to fix the crashed database, users cannot log on to the background if there is a problem with the database. Therefore, be sure to delete the database from the wp-config.php file after fixing and optimizing the database.
Increase PHP memory limit: Solve the problem of memory depletion (Fatal error: Allowed memory size of XXXXXX bytes exhausted) define ('WP _ MEMORY_LIMIT ', '64m'); // 64 but the setting is larger
Move the wp-content directory: Define ('WP _ CONTENT_DIR ', $ _ SERVER ['document _ root']. '/blog/wp-content'); define ('WP _ CONTENT_URL', 'http: // example/blog/WP-content '); define ('WP _ PLUGIN_DIR ', $ _ SERVER ['document _ root']. '/blog/wp-content/ins'); define ('WP _ PLUGIN_URL ', 'http: // example/blog/WP-content/plugins '); here, the special prize plug-in directory is written because some plug-ins cannot be moved without special instructions.
Custom User/UserMeta form:By default, WordPress saves all user data in the wp_users and wp_usermeta forms. The following function allows you to save user information anywhere. Define ('custom_user_table ', $ table_prefix. 'My _ users'); define ('custom_user_meta_table', $ table_prefix. 'My _ usermeta ');
Related Article

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.