Error 500 Not Resolving
-
Hi,
I have a problem with the 500 Internal Server Error.
I changed something on my site (the grouped-content.php) and updated it, and then the site had the error. So then I went through the regular steps, and realized to change the file back to normal, but even with the file back to normal, I still have the error. ??
Also my site is theblackandwhite.netThanks
-
Do you have access to your server logs. A 500 error can be caused by all kinds of things and the best way to find out what is causing it is to look at the PHP or Apache logs.
@justingreerbbi
I think I might, but I’m not sure how to access themPlease refer to your hosts documentation on how to access your server logs. They should be able to help you at least see what the error is. Once you find out, please share the error(s) here.
Thanks
So once I found the error logs, this is what seems to be the error, I’m not to sure this ones is it, but here it is:
PHP Warning: Unknown: open(/home/users/web/b984/pow.blackandwhite/htdocs/cgi-bin/tmp/sess_bcae49ed78ddfccb54d45b4044cff947, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
PHP Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/home/users/web/b984/pow.blackandwhite/htdocs/cgi-bin/tmp) in Unknown on line 0Umm.. Thats odd. Those errors do not have anything to do with WP. Those errors are server level. You did not edit any files outside of the WordPress root did you?
Being that that error is server side and has to do with the
cgi-bin
directory, your host may have to have a look at it.I only edited a file from my site, so I don’t think I could have edited the root files. If you want though I can give you the whole file since I don’t know what error to look for exactly
Here is another error that I’m pretty sure has to do with WP, and maybe has to do with why my site is down
WordPress database error Not unique table/alias: 'wp_users' for query SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_users ON wp_users.ID=wp_posts.post_author INNER JOIN wp_users ON wp_users.ID=wp_posts.post_author LEFT JOIN wp_comments ON wp_comments.comment_post_ID=wp_posts.ID WHERE 1=1 AND (((wp_users.display_name LIKE '%matt%') OR (wp_users.display_name LIKE '%franzel%') OR (wp_comments.comment_author LIKE '%matt%') OR (wp_comments.comment_author LIKE '%franzel%') OR (wp_comments.comment_content LIKE '%matt%') OR (wp_comments.comment_content LIKE '%franzel%') OR (wp_posts.post_excerpt LIKE '%matt%') OR (wp_posts.post_excerpt LIKE '%franzel%') OR (wp_posts.post_title LIKE '%matt%') OR (wp_posts.post_content LIKE '%matt%')) AND ((wp_posts.post_title LIKE '%franzel%') OR (wp_posts.post_content LIKE '%franzel%')) OR (wp_posts.post_title LIKE '%matt franzel%') OR (wp_posts.post_content LIKE '%matt franzel%')) AND (wp_posts.post_password = '') AND wp_posts.post_type != 'revision' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 7 made by require, wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts WordPress database error Not unique table/alias: 'wp_users' for query SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts INNER JOIN wp_users ON wp_users.ID=wp_posts.post_author INNER JOIN wp_users ON wp_users.ID=wp_posts.post_author LEFT JOIN wp_comments ON wp_comments.comment_post_ID=wp_posts.ID WHERE 1=1 AND (((wp_users.display_name LIKE '%whitman%') OR (wp_users.display_name LIKE '%shorts%') OR (wp_comments.comment_author LIKE '%whitman%') OR (wp_comments.comment_author LIKE '%shorts%') OR (wp_comments.comment_content LIKE '%whitman%') OR (wp_comments.comment_content LIKE '%shorts%') OR (wp_posts.post_excerpt LIKE '%whitman%') OR (wp_posts.post_excerpt LIKE '%shorts%') OR (wp_posts.post_title LIKE '%whitman%') OR (wp_posts.post_content LIKE '%whitman%')) AND ((wp_posts.post_title LIKE '%shorts%') OR (wp_posts.post_content LIKE '%shorts%')) OR (wp_posts.post_title LIKE '%whitman shorts%') OR (wp_posts.post_content LIKE '%whitman shorts%')) AND (wp_posts.post_password = '') AND wp_posts.post_type != 'revision' AND (wp_posts.post_status = 'publish') ORDER BY wp_posts.post_date DESC LIMIT 0, 7 made by require, wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
Thanks so much for the help, I hope we can solve this
Re-download the theme that you are using and manually upload all the theme contents into your active theme directory on your website using FTP. Override all the theme files. This will restore the theme files to the original state. Attempt to visit the site again.
Before you do anything else, please make a backup.
I’m using a custom theme, but I’ll see what I can do.
Also if I rename the current theme via FTP, it should go to a default theme right? And if it doesn’t work, I could rule out theme error and that it is a problem with the server right?Nvr mind, I did that and it did go back to normal so yeah it is a problem with the theme. Can I show you the file that I changed could you check if there is a problem with it?
Here is the code, hopefully you can find an error that might solve this:
<?php /** * The Black and White Grouped Content * * This module handles the grouping of a set of articles under a * taxonomy of your choosing. * * By default, groupings of posts will be selected using the given * taxonomy, and then additional posts will be drawn to populate * each of those groups with more posts. */ class Grouped_Content { /** * Instantiate. * * All custom functionality will be hooked into the "init" action. * * @static * @access public * @since 3.1 */ public static function setup() { add_action( 'init', array( __CLASS__, 'init' ), 30 ); } /** * Conditionally hook into WordPress. * * Theme must declare that they support this module by adding * add_theme_support( 'grouped-content' ); during after_setup_theme. * * If no theme support is found there is no need to hook into WordPress. * We'll just return early instead. * * @static * @access public * @since 3.1 */ public static function init() { $theme_support = get_theme_support( 'grouped-content' ); // Return early if theme does not support Grouped Content. if ( ! $theme_support ) { return; } /* * An array of named arguments must be passed as the second parameter * of add_theme_support(). */ if ( ! isset( $theme_support[0] ) ) { return; } // Return early if "grouped_content_filter" has not been defined. if ( ! isset( $theme_support[0]['grouped_content_filter'] ) ) { return; } $filter = $theme_support[0]['grouped_content_filter']; add_filter( $filter, array( __CLASS__, 'get_grouped_posts' ) ); } /** * Get grouped posts. * * @static * @access public * @since 3.1 * * @return array Array of grouped posts. */ public static function get_grouped_posts() { $grouped_ids = self::get_grouped_post_ids(); $grouped_posts = array_map( array( __CLASS__, 'get_posts_by_ids' *), $grouped_ids ); return $grouped_posts; } /** Get grouped post IDs * * This function will return the an array containing the * post IDs of all grouped posts. * * @static * @access public * @since 3.1 * * @return array Array of post IDs. */ public static function get_grouped_post_ids() { // Get the posts. $posts = new WP_Query( array( 'author' => get_query_var( 'author' ), 'cat' => get_query_var( 'cat' ), 'tag' => get_query_var( 'tag' ), 'tax_query' => get_query_var( 'tax_query' ), 'year' => get_query_var( 'year' ), 'monthnum' => get_query_var( 'monthnum' ), 'day' => get_query_var( 'day' ), 'post_type' => get_query_var( 'post_type' ) ) ); $posts = $posts->get_posts(); // Loop over all the posts, and start sorting them by tag. $posts_by_tag = array(); $post_ids = array(); foreach ( $posts as $post ) { $tags = get_the_tags( $post->ID ); if ( empty( $tags ) ) continue; $post_ids[] = $post->ID; // Loop over each tag and add it to our index. foreach ( $tags as $tag ) { if ( $posts_by_tag[ $tag->term_id ] ) $posts_by_tag[ $tag->term_id ][] = $post->ID; else $posts_by_tag[ $tag->term_id ] = array( $post->ID ); } } // Create the final array. $grouped = array(); foreach ( $posts_by_tag as $tag => $posts ) { // Sanitize the posts by removing any that have already been * included. $sanitized_posts = array_intersect( $posts, $post_ids ); $post_ids = array_diff( $post_ids, $sanitized_posts );* $grouped[ $tag ] = $sanitized_posts; } return $grouped; } /** Get an array of post objects given an array of post IDs. * * This is used as an auxilary function for the array_mapping * done in Grouped_Content::get_grouped_posts(). */ @static @access public @since 3.1 @param Array $post_ids @return Array Array of posts. public static function get_posts_by_ids( $post_ids ) { return get_posts( array( 'include' => $post_ids, 'posts_per_page' => count( $post_ids ) ) ); } } // Grouped_Content Grouped_Content::setup(); ?>
- The topic ‘Error 500 Not Resolving’ is closed to new replies.