Wordpress tips for use-wp-config.php skills

Source: Internet
Author: User
Wordpress tips-wp-config.php tips if the functions. php file is the most important file in the WordPress topic, what is the most important for the entire WordPress? It should be a wp-config.p Wordpress tip for Big use-wp-config.php tip

If the functions. php file is the most important file in the WordPress topic, what is the most important for the entire WordPress? It should be a wp-config.php file. It can be used to configure database functions, improve performance, and improve the security of all WordPress-driven websites and blogs. It can be seen that the importance of this file is extraordinary. So the several WordPress configuration skills I shared with you in this article are also very important. I hope you can learn it!

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, this automatic creation process actually adds and modifies the main WordPress configuration. Therefore, let's take a look at what the automatic creation process has done for you.

After uploading WordPress to the site via FTP, you will see the following page:

A configuration file is required to operate. you can create a configuration file (this is a sample) on the web interface ), but the configuration file wp-config-sample.php for this sample is not necessarily suitable for all hosts. If you are using a very popular host, it can operate. The next step will be like this:

Enter some key information where WordPress can be connected to the database. All information entered here will also be added to your profile wp-config.php:

Define ('Db _ name', 'database-name ');
Define ('Db _ user', 'database-username ');
Define ('Db _ password', 'database-password ');
Define ('Db _ host', 'localhost ');

By default, the database host is localhost because it applies to most hosts. However, some hosts have different configurations, so if you use the following host, you still need to modify it:

??? 1and1 Hosting-db12345678
??? DreamHost-mysql.example.com
??? GoDaddy-h41mysql52.secureserver.net
??? ICDSoft-localhost:/tmp/mysql5.sock
??? MediaTemple (GS)-internal-db.s44441.gridserver.com
??? Pair Networks-dbnnnx.pair.com
??? Yahoo-mysql

Digging into WordPress ebook has talked about one of the coolest wp-config.php configuration techniques, through which you can detect the database host, the code is as follows:

Define ('Db _ host', $ _ ENV {DATABASE_SERVER });

Paste the code above, it is likely to be able to master your database server, but in this case, you certainly need to manually edit the wp-config.php configuration file.

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.