WordPress.org

Ready to get started?Download WordPress

Forums

PHP 5 (11 posts)

  1. johnbakeronline
    Member
    Posted 5 years ago #

    I've been trying to move to a new server with PHP 5, and I've installed WP and reinstalled but have ended up once more with an installation that doesn't quite work.
    Everything looks OK and the speed is much faster, but the internal links on the blog become unstable. Perhaps 20% of the time a link is followed it registers correctly in the address bar but the actual link on the page goes elsewhere. If I click on, say 'about' the link might take me to the rss feed, or to the archives, anywhere but where I wanted to go.
    Now, if I hit F5 I usually go to the correct link, but when I hit F5 repeatedly, the link is liable to go astray again.
    I cannot detect a pattern here, the wrong links seem to happen erratically.
    If anyone has a clue what's happening here I'll be might grateful.
    The current installation which demonstrates this behaviour is at:
    http://www.govindbaker.co.uk

  2. johnbakeronline
    Member
    Posted 5 years ago #

    Sorry, I'll give that link again:
    http://govindbaker.co.uk/
    And the links which should demonstrate the problem are in the footer, under the heading: Info On This Site.

  3. tomontoast
    Member
    Posted 5 years ago #

    This is a very interesting case. This could be caused by three things. The mod_rewrite on your server (most likely), wordpress's redirects getting muddled up or a weird plugin bug (least likely). To be able to find the problem you may wish to carry out some diagnostics tests. I don't have time to detail these now but essentially you need to find out where mod_rewrite is rewriting your urls to on each request.

  4. johnbakeronline
    Member
    Posted 5 years ago #

    Thanks for getting back to me on this. All the plugins have been disabled, so it's not down to that.
    Would be really good if you could give me some idea how to do these diagnostic tests . . .
    The blog is running fine on the old server, but I really need some PHP5 functionality.

  5. tomontoast
    Member
    Posted 5 years ago #

    A quick test to start off would be to disable the pretty permalinks and resort to the default ie. index.php?p=45.
    This doesn't use mod_rewrite so if the problem stops occurring we can conclude that it is mod_rewrite playing up.
    Could you open up your htaccess file and see if there is anything abnormal in it that could be causing this problem.

  6. johnbakeronline
    Member
    Posted 5 years ago #

    If I disable the pretty permalinks the site functions correctly.
    The HTaccess file looks like this:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Any help with this problem would be greatly appreciated.

  7. johnbakeronline
    Member
    Posted 5 years ago #

    Is there no help for this problem?
    I don't know where to go from here.

  8. tomontoast
    Member
    Posted 5 years ago #

    Seeing as it works with permalinks disabled it means the error is an internal wordpress error. Try adding $wp_rewrite->flush_rules(); into functions.php in your theme. Visit your site once and then remove that line of code. This should force wordpress to refresh its internal redirect system. I have no idea whether it'll work.

  9. Oscar Gonzalez
    Member
    Posted 5 years ago #

    If tomontoast's suggestion doesn't do it... then maybe this can steer you in the right direction.

    new server with PHP 5

    Is this your own server? if so, you have access to the raw apache logs presumably...

    Or maybe its hosted but you you have access to the raw apache logs, you could tail the logs and see if any of the requests give you a clue. But this of course depends on access to those logs.

  10. tomontoast
    Member
    Posted 5 years ago #

    Rakxzo,

    We've figured out this is definitely an internal wordpress error. There is no need to look at apache logs!

  11. johnbakeronline
    Member
    Posted 5 years ago #

    Still the same problem here. I tried your solution, Tomontoast, but it didn't make any difference.
    Does anyone have any other ideas?
    As it is we're going to reinstall once again, but this is getting quite tiresome.

Topic Closed

This topic has been closed to new replies.

About this Topic