WordPress.org

Ready to get started?Download WordPress

Forums

Lots of PHP Problems: Please help!!! (30 posts)

  1. divineiniquity
    Member
    Posted 6 years ago #

    I have recently upgraded to WordPress 2.2, for about several weeks now and all of a sudden I can no longer visit moderation.php to moderate comments. Furthermore I cannot view any other pages of my blog other than the first page which is strange. Now there are also several more admin functions which I cannot use such as editing comments and such. Please take a look and tell me what's wrong:

    http://blog.divineiniquity.net

    I think my problem is that when I upgraded I simple overwrote all the files although I don't think my FTP did it right. Please help me, Im losing faith in this forum.

  2. Class
    Member
    Posted 6 years ago #

    Did you check if your permalink setup works?

    Im losing faith in this forum

    I don't think this will inspire people to help.

  3. divineiniquity
    Member
    Posted 6 years ago #

    yes my bad for saying that. It's just that I havn't had much luck getting responses for a while now. I withdraw that statement.

    As for permlinks I've set it numeric since it has the shortest URL path but that's it...I am not sure of what to do with it, they seem fine I think.

    Ok I think the "Next Page" links work now so all I need with at the moment is with the "moderation.php"...can't access it. It returns a 403 forbidden error I think because it's my webhost's custom error page which redirects to the home page.

  4. Class
    Member
    Posted 6 years ago #

    I visited your page earlier and got a few "not found" when clicking some links and got redirected to your host (?) but now it seems to be working?

    Maybe you can check your webserver logs?

  5. Class
    Member
    Posted 6 years ago #

    Have you checked the permissions on the moderation.php file?

  6. divineiniquity
    Member
    Posted 6 years ago #

    Thanks. Umm what number should they be...mine are all set to 755.

    The problem also exists for the "edit_comments.php" file. Which means I cannot even view the comments in the admin panel. Does this have anything to do with the database?

  7. Chris_K
    Member
    Posted 6 years ago #

    Kinda sounds like a mod_security issue. If so, whooami's oft-repeated advice follows:

    IF YOU DO NOT HAVE an .htaccess in your wp-admin/ directory:

    create a text file on your desktop:

    put the following inside it:

    <IfModule mod_security.c>
    SecFilterInheritance Off
    </IfModule>

    save the file. name it whatever you want

    Upload the file to your wp-admin directory.

    Rename the uploaded file to .htaccess (with the .)

    IF YOU DO HAVE an .htaccess in your wp-admin/ directory:

    Edit it, and add the following:

    <IfModule mod_security.c>
    SecFilterInheritance Off
    </IfModule>

    save the new .htaccess

  8. divineiniquity
    Member
    Posted 6 years ago #

    alright thanks man Ill see if it works :P

  9. divineiniquity
    Member
    Posted 6 years ago #

    alright thanks man Ill see if it works :P

    ok I just checked. It actually made things worse:

    Firstly the .htaccess file was actually located in my main wordpress directory: one level above wp-admin.

    Secondly it already had this text in it:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    If I add what you just told me to I get a 500 internal error.

  10. Chris_K
    Member
    Posted 6 years ago #

    Firstly the .htaccess file was actually located in my main wordpress directory: one level above wp-admin.

    Re-read the quoted bit in my post. Read for context and notice the directory names listed.

  11. divineiniquity
    Member
    Posted 6 years ago #

    yes I know what you're talking about and so I'll explain to you what I meant:

    the .htaccess file your quote refers to should be located in this directory ".../Wordpress/wp-admin/.htaccess"

    However my existing .htaccess file is located as thus:
    ".../Wordpress/.htaccess"

    I have followed your quoted section and made a new .htaccess file and uploaded it so that it matches the directory of the first instance I said. This is the resukt:

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    you can check on my site as well.

  12. Chris_K
    Member
    Posted 6 years ago #

    Err, you can have more than one .htaccess file. One per directory even!

    Stop messing with your "main" one.

    Create the one in the wp-admin directory as the instructions above mention.

    the .htaccess file your quote refers to should be located in this directory ".../Wordpress/wp-admin/.htaccess"

    exactly. Don't touch the other one. Create THAT one.

  13. whooami
    Member
    Posted 6 years ago #

    AND additionally, what has been provided to you will NOT cause ANY error. So if you are seeing one, its a result of you not pasting properly.

  14. divineiniquity
    Member
    Posted 6 years ago #

    ok I think I better start this all over again:

    Firstly (before anything happend here), I was unable to access the comments page in the admin panel. Furthermore I cannot moderate any of the new comments through moderation.php. That is the original problem.

    Your instructions was to create a .htaccess file in this directory:

    ...Wordpress/wp-admin/.htaccess

    With the text:

    <IfModule mod_security.c>
    SecFilterInheritance Off
    </IfModule>

    This file exists in that location right now.

    Also I have another .htaccess file in this directory:

    ...Wordpress/.htaccess

    With this text:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    With both of these .htaccess files in their approprite directories, I can no longer access the wp-admin at all, let alone moerate comments and such.

    At whooami: If I have pasted the text wrong for the first .htaccess file then tell me what's wrong because the text I have entered is exactly what appears in this post.

    Right now this is not working...

    http://blog.divineiniquity.net you can take a look if you don't believe me, try and click on "Site Admin", you won't be able to get into the login screen for the admin panel.

    At the moment I am getting this: (500 Internal Server Error)

    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, [no address given] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

  15. divineiniquity
    Member
    Posted 6 years ago #

    Can someone please help me with this problem? It's starting to get on my nerves.

  16. Jeremy Clark
    Moderator
    Posted 6 years ago #

    Try it again I can get your login just fine, although without any styling.

  17. moshu
    Member
    Posted 6 years ago #

    Same here: the login is displayed although no style. The wp-admin stylesheet results in 500 error.

  18. Chris_K
    Member
    Posted 6 years ago #

    Just saw another thread where this worked instead of the previously suggested code:

    <IfModule mod_security.c>
    SecFilterEngine Off
    </IfModule>
  19. Jeremy Clark
    Moderator
    Posted 6 years ago #

    See my post below.

  20. whooami
    Member
    Posted 6 years ago #

    yes Im going to have to update my paste :P

  21. Chris_K
    Member
    Posted 6 years ago #

    So, out of curiosity... does this "newer" version work with old and new mod_security?

  22. whooami
    Member
    Posted 6 years ago #

    yes, that should disable it completely, regardless.

  23. Jeremy Clark
    Moderator
    Posted 6 years ago #

    Sorry made a mistake the directives are SecRuleInheritance and SecRuleEngine turning either one of these off with an .htaccess file stops the mod_security rules from applying to that directory but with SecRuleInheritance you can still apply other rules in the .htaccess file. Both of these directives are for version 2.0 and higher mod_security only. Earlier versions used SecFilterInheritance and SecFilterEngine as HandySolo pointed out.

    And actually divineiniquity if you still can't get it try this in that .htaccess file

    <IfModule mod_security.c>
    SecRuleEngine Off
    </IfModule>
  24. whooami
    Member
    Posted 6 years ago #

    i sit corrected. suppose I could actually go look ..

  25. Jeremy Clark
    Moderator
    Posted 6 years ago #

    I actually had to look it up after my first incorrect post after I thought about it for awhile. It's been awhile since I had setup my mod security, but I double checked everything on the mod security website.

  26. divineiniquity
    Member
    Posted 6 years ago #

    Just a question before I go thropugh with what's been said: Why doesn't WordPress auto-configure this sort of stuff before distributing the entire package?

  27. Jeremy Clark
    Moderator
    Posted 6 years ago #

    WordPress has nothing to do with mod_security. It's software that your host has installed on their servers. Not everyone has mod_security on their server and if they do not everyone has strict rules that cause problems.

    Just go ahead and try the code I pasted earlier and see if it helps, it won't cause any other harm.

    <IfModule mod_security.c>
    SecRuleEngine Off
    </IfModule>
  28. divineiniquity
    Member
    Posted 6 years ago #

    Yeah I tried this piece of code:

    <IfModule mod_security.c>
    SecRuleEngine Off
    </IfModule>

    shove it into the "...Wordpress/wp-admin/.htaccess" file right?

    Didn't work...still 500 internal error.

  29. Jeremy Clark
    Moderator
    Posted 6 years ago #

    Apparently your host doesn't allow Mod_security directives in .htaccess files which isn't a big problem, that's how I have my mod_security setup, now you'll just have to call your host and have them turn off mod_security for the wp-admin folder.

  30. divineiniquity
    Member
    Posted 6 years ago #

    hmm maybe I should try to reinstall the whole thing again...and that means reposting every thing I've typed up...as in recreate the whole database from scratch because I believe the error is probably in the database. Because it doesnt make sense that WordPress 2.2 works fine for a few days and then suddenly everything stuffs up...either that or I simply don't moderate comments anymore.

Topic Closed

This topic has been closed to new replies.

About this Topic