WordPress.org

Ready to get started?Download WordPress

Forums

Comments problem (4 posts)

  1. Omnia
    Member
    Posted 5 years ago #

    Hi all.

    I'm the founder of the site |Omnia Blog|. I have installed wordpress 2.6 and the theme Super Adsense Music Theme 2.1 but now i have the problem that when a user sends comments, appear this mex:

    Warning: require_once(../../../wp-config.php) [function.require-once]: failed to open stream: No such file or directory in /web/htdocs/www.omniablog.net/home/wp-content/themes/super-adsense-music/super-adsense-music/comments-ajax.php on line 2

    Fatal error: require_once() [function.require]: Failed opening required '../../../wp-config.php' (include_path='.:/php/lib/php/') in /web/htdocs/www.omniablog.net/home/wp-content/themes/super-adsense-music/super-adsense-music/comments-ajax.php on line 2

    How I can fix this error? Please help me! Thanks.

  2. chaoskaizer
    Member
    Posted 5 years ago #

    seem like comments-ajax cant find the wp-config.php

    find on line 2 (comments-ajax.php)

    require_once '../../../wp-config.php';

    replace with

    $wp_root = dirname(dirname(dirname(dirname(__FILE__))));
    $config_file = ( file_exists($wp_root.DIRECTORY_SEPARATOR.'wp-load.php') ? 'wp-load.php' : 'wp-config.php' );
    if ($config_file) require_once($wp_root.DIRECTORY_SEPARATOR.$config_file);
  3. Omnia
    Member
    Posted 5 years ago #

    Thanks chaoskaizer! I replace

    require_once '../../../wp-config.php';

    with

    $wp_root = dirname(dirname(dirname(dirname(__FILE__))));
    $config_file = ( file_exists($wp_root.DIRECTORY_SEPARATOR.'wp-load.php') ? 'wp-load.php' : 'wp-config.php' );
    if ($config_file) require_once($wp_root.DIRECTORY_SEPARATOR.$config_file);

    But now when I send a comment appear this mex:

    Warning: require_once(/web/htdocs/www.omniablog.net/home/wp-content/wp-config.php) [function.require-once]: failed to open stream: No such file or directory in /web/htdocs/www.omniablog.net/home/wp-content/themes/super-adsense-music/super-adsense-music/comments-ajax.php on line 4

    Fatal error: require_once() [function.require]: Failed opening required '/web/htdocs/www.omniablog.net/home/wp-content/wp-config.php' (include_path='.:/php/lib/php/') in /web/htdocs/www.omniablog.net/home/wp-content/themes/super-adsense-music/super-adsense-music/comments-ajax.php on line 4

    What do I do?

  4. chaoskaizer
    Member
    Posted 5 years ago #

    Sorry bout that, on second thought I think its better to used your absolute path.

    replace all the previous code with

    require_once '/web/htdocs/www.omniablog.net/home/wp-config.php';

    On another notes,
    Your "super-adsense-music" theme structure is kind of wrong

    wp-content/themes/super-adsense-music/super-adsense-music

    The theme's files should be install at ↓

    wp-content/themes/super-adsense-music

    not inside another sub-directory. just my 2¢

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags