How To Force WordPress to Connect to the Database via TCP

wp-config.php
1 2 |
define('DB_HOST', '127.0.0.1:3306'); define('DB_PORT', 3306); |
![]() |
wp-config.php
1 2 |
define('DB_HOST', '127.0.0.1:3306'); define('DB_PORT', 3306); |
If you are trying to install a WordPress plugin and get this error: “Unable To Locate WordPress Content Directory (wp-content)” Add this code at the bottom of {wp_install_dir}/wp-config.php: if(is_admin()) { add_filter(‘filesystem_method’, create_function(‘$a’, ‘return “direct”;’ )); define( ‘FS_CHMOD_DIR’, 0751 ); } As an added benefit, you will no longer be prompted for an FTP login and […]