• anjan011

    (@anjan011)


    Hi!

    I am facing a redirect to wp-admin/install.php page

    What i m doing is, i have wordpress installed in /blog folder under public_html, that is wordpress is the blog for my main site. i will post updates and news about various events in the blog. And i want to show 5 latest blog post on our site homepage.

    To do this i have made a php include file “latest_blog_posts.inc.php”

    With the following test code —

    <?php
    	define('WP_USE_THEMES', false);
    	require('c:/wamp/www/onlyfreelancer/blog/wp-blog-header.php');
    ?>
    <?php query_posts('showposts=5'); ?>
    <?php while (have_posts()) : the_post(); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a><br />
    <?php endwhile;?>

    Now when i load the inc page directly in browser it shows the posts ok. But when i include it in my site’s homepage it redirects me to the install.php page

    Upon check i have found that the sql query to fetch siteurl value in is_blog_installed() function evaluates to this –

    SELECT option_value FROM options WHERE option_name = 'siteurl'

    That is instead of being “wp_options” it is simply “options”, missing the prefix. For this the siteurl value can’t be fetched and wordpress calculates that its not installed.

    How to fix this? This problem only occurs when i include the inc to my site’s home page. or any other page. It works when its loaded directly in the browser.

    Thanks,
    Anjan

Viewing 1 replies (of 1 total)
  • I’ve got exactly the same problem. I’ve ran a repair on the wp_options table but still no luck. The $table_prefix is set to ‘wp_’ in wp-config.php so why is it not using this in the is_blog_installed() function?

Viewing 1 replies (of 1 total)
  • The topic ‘Empty table prefix returned instead of default 'wp_' prefix’ is closed to new replies.