Hướng dẫn xử lý lỗi WordPress.
Khi truy cập website wordpress hiển thị báo lỗi như bên dưới.
“Catchable fatal error: Object of class WP_Error could not be converted to string in public_html/wp-includes/rewrite.php on line 326”
- kiểm tra các tập tin rewrite.php tại dòng 326 trong thư mục wp-includes. Code bên dưới.
function _wp_filter_taxonomy_base( $base ) {
if ( ! empty( $base ) ) {
$base = preg_replace( '|^/index\.php/|', '', $base );
$base = trim( $base, '/' );
}
return $base;
}
– Vấn đề không phải nằm ở rewrite.php, do đó không chỉnh sửa hoặc thay đổi trong file này.
Khi kiểm tra Database của website trong bảng wp-options có 1 bảng category_base với giá trị:
O:8:"WP_Error":2:{s:6:"errors";a:1:{s:30:"wpdb_get_table_charset_failure";a:1:{i:0;s:0:"";}}s:10:"error_data";a:0:{}}
1. Đăng nhập vào cPanel –> phpMyAdmin –>chọn database ->wp_options.
Edit category_base thay đổi nó loại bỏ nó đi xong nhấp vào Go.
Sau khi thực hiện xong truy cập kiểm tra website.
https://www.pavietnam.vn/vn/tin-tuc-chuong-trinh-khuyen-mai-ten-mien-hosting.html