A roundup of common WordPress errors

1 Unable to add a category: Could not insert term into the database

This issue can have several causes. Here are a few fixes you can try:
1) Try repairing the database tables:
Open the wp-config.php configuration file and add the following line:

define('WP_ALLOW_REPAIR', true);

Go to:
http://yourwebsite.com/wp-admin/maint/repair.php

Then comment out the line you just added.

If this doesn’t fix the issue, try the next step.

2) Check the database table structure:

ALTER TABLE `wp_terms` CHANGE `term_id` `term_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER TABLE wp_terms AUTO_INCREMENT = 1000;

The value 1000 above is just an example. Set the next auto-increment value based on the entries already in wp_terms.

You may also need to change the following:

ALTER TABLE `wp_term_taxonomy` CHANGE `term_taxonomy_id` `term_taxonomy_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT;

3) Check for duplicate entries:
Make sure the entry you’re trying to add isn’t already in the database. If an entry with the same name already exists, WordPress won’t let you add a duplicate.

2 PHP Warning: Constant FS_CHMOD_DIR already defined

If you see this warning, change:

define('FS_CHMOD_FILE', 0644);

define('FS_CHMOD_DIR', 0755);

to:

if ( ! defined( 'FS_CHMOD_FILE' ) ) {
    define('FS_CHMOD_FILE', 0644);
}
if ( ! defined( 'FS_CHMOD_DIR' ) ) {
    define('FS_CHMOD_DIR', 0755);
}

3 PHP Warning: failed to open stream: No such file or directory (advanced-cache.php)

This error can occur when plugins like WP Super Cache or W3 Total Cache leave configuration settings behind after being uninstalled.
Try opening wp-config.php and making the following change:
Change:

define( 'WP_CACHE', true ); 

to:

define( 'WP_CACHE', false );

If there are any other similar path settings, comment them out:

// define( 'WPCACHEHOME', '/alidata/liuxiao.org/wp-content/plugins/wp-super-cache/' );
// define('W3TC_EDGE_MODE', true); // Added by W3 Total Cache

Add a Comment

Your email address will not be published. Required fields are marked *