2/11/2015 Editing wp­config.php « WordPress Codex Search WordPress.org Ready to get started? Download WordPress Codex Codex tools: Log in Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference! Editing wp­config.php Languages: English • Deutsch • Français • Hrvatski • Italiano • 日本語 • Português do Brasil • Русский • ไทย • 中文(简体) • (Add your language) One of the most important files in your WordPress installation is the wp‐config.php Contents file. This file is located in the root of your WordPress file directory and contains your website's base configuration details, such as database connection information. 1 Configure Database Settings 1.1 Default wp­config­sample.php When you first download WordPress, the wp‐config.php file isn’t included. The 1.1.1 Set Database Name WordPress setup process will create a wp‐config.php file for you based on the 1.1.2 Set Database User information you provide. 1.1.3 Set Database Password 1.1.4 Set Database Host Advanced users can manually create a wp‐config.php file by locating the sample file 1.1.4.1 Possible DB_HOST named "wp­config­sample.php" (located in the root install­directory), editing it as values required, and then saving it as wp‐config.php. 1.1.4.2 MySQL Alternate Port 1.1.4.3 MySQL Sockets or Pipes 1.2 Database character set 1.3 Database collation 1.4 Security Keys 2 Advanced Options 2.1 table_prefix 2.2 WordPress address (URL) 2.3 Blog address (URL) 2.4 Moving wp­content folder 2.5 Moving plugin folder 2.6 Moving themes folder http://codex.wordpress.org/Editing_wp­config.php#Increasing_memory_allocated_to_PHP 1/23 2/11/2015 Editing wp­config.php « WordPress Codex 2.7 Moving uploads folder 2.8 Modify AutoSave Interval 2.9 Post Revisions 2.9.1 Disable Post Revisions 2.9.2 Specify the Number of Post Revisions 2.10 Set Cookie Domain 2.11 Enable Multisite / Network Ability 2.12 Redirect Nonexistent Blogs 2.13 Debug 2.14 Disable Javascript Concatenation 2.15 Configure Error Logging 2.16 Increasing memory allocated to PHP 2.17 Cache 2.18 Custom User and Usermeta Tables 2.19 Language and Language Directory 2.19.1 WordPress v4 and above 2.19.2 WordPress v3.9.2 and below 2.20 Save queries for analysis 2.21 Override of default file permissions 2.22 WordPress Upgrade Constants 2.22.1 Enabling SSH Upgrade Access 2.23 Alternative Cron 2.24 Disable Cron and Cron Timeout 2.25 Additional Defined Constants 2.26 Empty Trash 2.27 Automatic Database Optimizing 2.28 Do not upgrade global tables 2.29 View All Defined Constants 2.30 Disable the Plugin and Theme Editor 2.31 Disable Plugin and Theme Update and Installation 2.32 Require SSL for Admin and Logins http://codex.wordpress.org/Editing_wp­config.php#Increasing_memory_allocated_to_PHP 2/23 2/11/2015 Editing wp­config.php « WordPress Codex 2.33 Block External URL Requests 2.34 Disable WordPress Auto Updates 2.35 Disable WordPress Core Updates 3 Double Check Before Saving 4 External Resources 5 See Also NOTE: The contents of the wp‐config‐sample.php file are in a very specific order. The order matters. If you already have a wp‐ config.php file, rearranging the contents of the file may create errors on your blog. To change the wp‐config.php file for your installation, you will need this information: Database Name Database Name used by WordPress Database Username Username used to access Database Database Password Password used by Username to access Database Database Host The hostname of your Database Server. A port number, Unix socket file path or pipe may be needed as well. If your hosting provider installed WordPress for you, get the information from them. If you manage your own web server or hosting account, you will have this information as a result of creating the database and user. Configure Database Settings Important: never use a word processor like Microsoft Word for editing WordPress files! Locate the file wp‐config‐sample.php in the base directory of your WordPress directory and open in a text editor. NOTE: Since Version 2.6, wp‐config.php can be moved to the directory directly above the WordPress application directory. Default wp‐config‐sample.php NOTE: This is an example of a default wp‐config‐sample.php. The values here are examples to show you what to do. Do not change these details here by editing this page, change them on your web server. If you make changes here by using the edit button, they will not work and you will be showing your password details to the world. // ** MySQL settings ‐ You can get this info from your web host ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'database_name_here' ); http://codex.wordpress.org/Editing_wp­config.php#Increasing_memory_allocated_to_PHP 3/23 2/11/2015 Editing wp­config.php « WordPress Codex /** MySQL database username */ define( 'DB_USER', 'username_here' ); /** MySQL database password */ define( 'DB_PASSWORD', 'password_here' ); /** MySQL hostname */ define( 'DB_HOST', 'localhost' ); NOTE: Text inside /* */ are comments, for information purposes only. Set Database Name Replace 'database_name_here', with the name of your database, e.g. MyDatabaseName. define( 'DB_NAME', 'MyDatabaseName' ); // Example MySQL database name Set Database User Replace 'username_here', with the name of your username e.g. MyUserName. define( 'DB_USER', 'MyUserName' ); // Example MySQL username Set Database Password Replace 'password_here', with the your password, e.g. MyPassWord. define( 'DB_PASSWORD', 'MyPassWord' ); // Example MySQL password Set Database Host Replace 'localhost', with the name of your database host, e.g. MyDatabaseHost. A port number or Unix socket file path may be needed as well. define( 'DB_HOST', 'MyDatabaseHost' ); // Example MySQL Database host NOTE: There is a good chance you will NOT have to change it. If you are unsure, try installing with the default value of 'localhost' and see if it works. If the install fails, contact your web hosting provider. Possible DB_HOST values Different hosting companies use different network settings for their mysql databases. If your hosting company is listed below in the left column, the value on the right is similar to the correct value for DB_HOST. Contact your tech support and/or search your hosting companies online Documentation to be sure. Hosting Company DB_HOST Value Guess http://codex.wordpress.org/Editing_wp­config.php#Increasing_memory_allocated_to_PHP 4/23 2/11/2015 Editing wp­config.php « WordPress Codex 1and1 db12345678 AN Hosting localhost Aruba.it localhost or real IP provided with activation mail. A Small Orange localhost AT&T xxxxxxxx.carrierzone.com full server name found in PHP MyAdmin. BlueHost localhost DreamHost mysql.example.com GoDaddy ­ Shared and In the Databases menu go to MySQL. To the right of the database name click on Actions and 4GH Hosting Details. The hostname is at the bottom of the window. GoDaddy ­ cPanel localhost Hosting GoDaddy ­ Plesk Use the IP address shown in the Databases Section in Plesk. Do not include :3306 Hosting HostGator localhost HostICan localhost ICDSoft localhost:/tmp/mysql5.sock Infomaniak Network mysql.yourdomain InMotion Hosting localhost iPage username.ipagemysql.com IPower username.ipowermysql.com LaughingSquid localhost MediaTemple Grid internal‐db.s00000.gridserver.com ­ (Replace "00000" with the actual site number) MediaTemple DV localhost MegnaHost localhost NearlyFreeSpeech.Net username.db NetworkSolutions mysqlv5 one.com example.com.mysql pair Networks dbnnnx.pair.com QTH.com localhost localhost for unmanaged servers, variable for Cloud Sites like mysqlXY‐ Rackspace Cloud AB.wcN.dfQ.stabletransit.com where X,Y,A,B,N,Q are variables SysFix.eu Power datapower.sysfix.eu Hosting Yahoo mysql Hosts with cPanel localhost Hosts with Plesk localhost Hosts with localhost DirectAdmin Tophost.it sql.your‐domain‐name.it MySQL Alternate Port http://codex.wordpress.org/Editing_wp­config.php#Increasing_memory_allocated_to_PHP 5/23 2/11/2015 Editing wp­config.php « WordPress Codex If your host uses an alternate port number for your database you'll need to change the DB_HOST value in the wp‐config.php file to reflect the alternate port provided by your host. For localhost define( 'DB_HOST', 'localhost:3307' ); Other define( 'DB_HOST', 'mysql.example.com:3307' ); Replace 3307 with whatever port number your host gives you. MySQL Sockets or Pipes If your host uses Unix sockets or pipes, adjust the DB_HOST value in the wp‐config.php file accordingly. define( 'DB_HOST', 'localhost:/var/run/mysqld/mysqld.sock' ); Replace /var/run/mysqld/mysqld.sock with the socket or pipe information provided by your host. Database character set As of WordPress Version 2.2, DB_CHARSET was made available to allow designation of the database character set (e.g. tis620 for TIS620 Thai) to be used when defining the MySQL database tables. The default value of utf8 (Unicode UTF­8) is almost always the best option. UTF­8 supports any language, so you typically want to leave DB_CHARSET at utf8 and use the DB_COLLATE value for your language instead. This example shows utf8 which is considered the WordPress default value: define( 'DB_CHARSET', 'utf8' ); WARNING: Those performing new installations There usually should be no reason to change the default value of DB_CHARSET. If your blog needs a different character set, please read Character Sets and Collations MySQL Supports for valid DB_CHARSET values. WARNING: Those performing upgrades (especially blogs that existed before 2.2) If DB_CHARSET and DB_COLLATE do not exist in your wp‐config.php file, DO NOT add either definition to your wp‐config.php file unless you read and understand Converting Database Character Sets. Adding DB_CHARSET and DB_COLLATE to the wp‐config.php file, for an existing blog, can cause major problems. Database collation http://codex.wordpress.org/Editing_wp­config.php#Increasing_memory_allocated_to_PHP 6/23 2/11/2015 Editing wp­config.php « WordPress Codex As of WordPress Version 2.2, DB_COLLATE was made available to allow designation of the database collation (i.e.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages23 Page
-
File Size-