• Resolved aesop7

    (@aesop7)


    Dear Ajay

    some of the hosting serveris OK.
    but some host is having ‘internal server error 500 ‘
    in file [top-10-counter.js.php]. I found it with google-chrom browser.

    I think that the error comes from your php code trying to read the [wp-config.php] file that is not permitted in some server.
    your plugin have pretty good appearence.
    So, pls solve this ASAP.

    https://wordpress.org/plugins/top-10/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ajay

    (@ajay)

    Hi,

    This is an issue with the plugin because I currently use an external file. The solution is a complete rewrite of the code which is eventually going to be done.

    The fix is relatively simple, but without having an exact detail of the configuration of the server, it’s not possible for me to suggest a fix.

    Thread Starter aesop7

    (@aesop7)

    Thank you for your reply.
    I’m now using my own server in my notebook.
    (Apach v 2.4, php v5.5.9, MySQL v 5.6.16)
    I can tell you the exact configuration that you want to know.
    what do you want to know?

    Thread Starter aesop7

    (@aesop7)

    I’m solving by myself.

    Modifying the files top-10-addcount.js.php andtop-10-counter.js.php as follows.

    //"top-10-counter.js.php" Display number of page views
    Header("content-type: application/x-javascript");
    // require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/wp-load.php');
    // Build the wp-config.php path from a plugin/theme
    $wp_config_path = dirname(dirname(dirname(dirname(__FILE__ ))));
    $wp_config_filename = '\wp-load.php';
    
    // Check if the file exists in the root or one level up
    if( !file_exists( $wp_config_path . $wp_config_filename ) ) {
        // Just in case the user may have placed wp-config.php one more level up from the root
        $wp_config_filename = dirname( $wp_config_path ) . $wp_config_filename;
    }
    // Require the wp-config.php file
    // require( $wp_config_filename );
     require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/wp-load.php');
    // Include the now instantiated global $wpdb Class for use
    global $wpdb;

    Your logic doesn’t work, I think.

    Thread Starter aesop7

    (@aesop7)

    the If syntex could be erasable as follws.

    //  if( !file_exists( $wp_config_path . $wp_config_filename ) ) {
    // Just in case the user may have placed wp-config.php one more level up from the root
    //    $wp_config_filename = dirname( $wp_config_path ) .  wp_config_filename;
    //  }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘different hosts, diferent results’ is closed to new replies.