WordPress.org

Ready to get started?Download WordPress

Forums

500 Internal Server Error after editing index.php file (14 posts)

  1. Loving40s
    Member
    Posted 3 years ago #

    Situation: my site went down, giving 500 Internal Server Error, but I still have access to my WP Admin/Dashboard page.

    This occurred right after I added some code to the index.php file. Usually, when I mess up with code editing, my admin panel goes down, so I just access the files through FTP and remove the code and all is well.

    This time the WP admin panel stayed up, but the website went down. (www.twific.net) So I removed the code I had entered and updated file. No go...website still down.

    So then I restored my theme that I had just saved to the server shortly before the website went down. Still getting error on website. So the files are back to what they were before I changed any coding, yet website still down. I'm utterly perplexed.

    So after searching this forum, I inactivated all my plugins. Still nothing. I'm using the 2010 Weaver theme but i've made lots of customizations on it. i changed back to the basic 2010 Weaver and also the twenty ten theme, and still getting error.

    Then I looked for the .htaccess file as someone in a post suggested the coding in there might be messed up. Can't find that file, and yes, I do have FTP set to see ALL files.

    Then I read that it might be that "the permissions' are not right. So i followed instructions to reset the permissions for all files to what they should be via FTP. I did that....still getting same error on website.

    I tried to find the error log from my server as somebody suggested (to find out the exact file that is causing the problem) but I can't find it anywhere in the cpanel. Will have to wait until monday to talk to my server's help desk.

    Please help! Any suggestions? I've tried everything I've found here in the forum and by googling it.

  2. govpatel
    Member
    Posted 3 years ago #

    Then I looked for the .htaccess file as someone in a post suggested the coding in there might be messed up. Can't find that file, and yes, I do have FTP set to see ALL files.

    .htaccess is hidden file so when click on file manager in cpanel in popup tick show hidden files.

  3. Loving40s
    Member
    Posted 3 years ago #

    When I access my files through FTP (filezilla), I do have it checked to show hidden files. I don't see an .htaccess file. My understanding is it should show up when I click the root folder, along with all the .php files? is that right?

    In my cpanel I don't see any "option" to show hidden files.

    I read somewhere that if you don't have permalinks, then you won't have a .htaccess file. I'm pretty sure I do have permalinks, at least in the 'add post' screen it shows the permalink http at the top. So I should have a .htaccess file, right?

    I'm new to all this...been researching, teaching myself css, etc so bear with me.

  4. Loving40s
    Member
    Posted 3 years ago #

    Ok, now I've just read that somewhere that an .htaccess file wont be created unless you change the permalinks option in WordPress. I have NOT changed the permalinks option, so I'm looking for an .htaccess file that probably isn't even there. S

    That was the only thing that I haven't tried. I need some suggestions short of having to reinstall WP and start all over. I've tried about 5 different things and nothing is working.

  5. govpatel
    Member
    Posted 3 years ago #

    Have tried and created a .htaccess file if you do not have one.

    then reset your permalinks by switching to default settings
    and check if your site opens.

    if it does then try switching to custom structure

  6. Loving40s
    Member
    Posted 3 years ago #

    I'm sorry, you'll have to talk to me like a noob because I am. Only been doing WP and css stuff for less than a week.

    Should I create the .htaccess file in the cpanel? Just do "new file" and name it .htaccess?

    What do you mean by switch to default settings? Do you mean change the theme back to the default twenty ten theme? Sorry, i need you to spell it out for me. Thanks so much.

  7. Loving40s
    Member
    Posted 3 years ago #

    ok, i found it. settings--permalinks. it is already set on default.

  8. govpatel
    Member
    Posted 3 years ago #

    If your site does not open the only other step left is to upload all files and folder except wp-content folder and wp-config.php

    delete them and then upload do not overwrite

  9. govpatel
    Member
    Posted 3 years ago #

    While I thinking again Did you ever try and switch to default twenty ten theme if it works then all you will need to do is rename the theme you were using and reinstall the theme.

  10. Loving40s
    Member
    Posted 3 years ago #

    I thought I had changed to the twenty ten theme, but now I realize I had only changed to a subtheme of 2010 Weaver. Now that I actually did it correctly per your suggestion (activated default twenty ten)...YES, my site is now showing up.

    So that tells us that something happened to one of the files/plugins associated with my current theme (2010 Weaver), right? So forgive me, but I don't understand how by just renaming the theme I'm using and reinstalling it would fix anything. Even if I rename it, won't the files be the same (which obviously have something wrong with them)?

    Please tell me step by step what I should do to hopefully not lose all my settings/plugins in the 2010 weaver theme.

    I've contacted my host server to find out where I can locate the server error logs, hoping that if I can find the file with the error, then I can just delete and reinstall only that file. Would that work?

  11. govpatel
    Member
    Posted 3 years ago #

    So forgive me, but I don't understand how by just renaming the theme I'm using and reinstalling it would fix anything. Even if I rename it, won't the files be the same (which obviously have something wrong with them)?

    As you made a change in that index.php file of 2010 weaver you must have broke the theme so by renaming the theme what you have done is forced wordpress to open twenty ten theme as it could not find the theme that is in database.

    Each theme is independent that is one of reasons why time after time in this forum is recommended not to make any changes in default twenty ten theme so that you will have a working theme that you can change to like you have done now.

    2010 weaver is child theme of twenty ten with modifications.
    You have not lost any plugins as they are not connected to themes but as for modifications you made on 2010 weaver I do not know how much modification you made if its that much you can reinstall 2010 weaver and change the settings.

  12. Loving40s
    Member
    Posted 3 years ago #

    If I won't lose plugin settings and posts, then I'm fine with redoing the customization on 2010 Weaver. It was mainly just changing the background and header and font colors.

    So do I rename the file in FTP or in the cpanel...or does it matter which place? Here is a screenshot of my FTP. http://bit.ly/fpApHx
    I just change the name of the main theme file...the one cirled, correct?

  13. Loving40s
    Member
    Posted 3 years ago #

    OMG! I sent an email last night to my host provider asking where I could find the error logs and briefly explaining the problem. I just got an email from them that they restored a backup copy of index.php. And ta-da: now it is working with the 2010 theme. Whew...what a relief. Thank you so much, govpatel, for your efforts to help me.

    I wish I understood what went wrong. I restored a backup copy of the entire theme and it didn't work. I put the index.php file back to exactly what it was before the site went down, and that didn't work. But they restore a backup copy and it does work? Oh, well....lol. Thanks again.

  14. govpatel
    Member
    Posted 3 years ago #

    Great as long as you got it all working

Topic Closed

This topic has been closed to new replies.

About this Topic