Forums

[resolved] Upgrading to 2.7 error (20 posts)

  1. nemo-maritime
    Member
    Posted 3 years ago #

    I just upgraded to 2.7 from 2.6.3 and I uploaded the new files to the server. When I go to the site, I get an error. It says - Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/MyRootUser/public_html/wp-config.php on line 56
    What is going on?

  2. Samuel B
    moderator
    Posted 3 years ago #

    what did you change in wp-config.php and why?
    That is one file you are not supposed to touch on upgrade.

  3. nemo-maritime
    Member
    Posted 3 years ago #

    Ohhh I didnt really change anything. I thought I was supposed to copy my settings from the old wp-change.php and into the new one. I copyed my info from the old wp-config.php into the new version. Am I just supposed to leave things alone? I didnt change anything in the new one, I just took my old ones settings and put it in the new one. In this case the $table_prefix - I put my old info into this new one. My old one was not the standard wp_ I changed it into a different one before my original installation.

  4. Otto
    Tech Ninja
    Posted 3 years ago #

    Well, copying the settings into the new one would not be a problem, however you clearly changed something in a bad way.

    Put the original wp-config.php file back and try using it unchanged from 2.6.3.

  5. nemo-maritime
    Member
    Posted 3 years ago #

    Thats what I did. It looks like it works, I dont have errors at least... the way I changed it is I took all the info I needed to from wp-config and put it into wp-config-sample then I copied everything from the sample into the main config and I uploaded it.... thats when I got an error. So I just tried reversing everything I did and put the old one back, and no more error, I can get into the admin panel, and I can post comments with no prob.... is this something I should be worried about though? Any errors forseen down the road?

    Update - One additional thing. I cant seem to get the different button between html/visual post writing. I have had this issue on another blog on the same server, the drop down for any of the menus that are supposed to have this option. Any ideas in that area? Would it be something with a server or something else. I tried erasing cached files from my browser, didnt seem to do anything

  6. nemo-maritime
    Member
    Posted 3 years ago #

    The option on the top right does not work for me. It shows new post, and I assume other options, but it does not drop down for me. Other options work, but this one does not. I am having the same issue on another site of mine. It also wont allow me to re-arange widgets and if I click add or edit widget, it just reloads the page. Please help me with this one, I have been stuck on it for 3 weeks now.

  7. Otto
    Tech Ninja
    Posted 3 years ago #

    Check that all your javascript files got uploaded to your site. Check that they are accessible. Check that your browser's error console isn't throwing any not found errors.

    Usually, when the dynamic bits don't work, it's because your javascript files are missing/broken.

  8. nemo-maritime
    Member
    Posted 3 years ago #

    SOLVED kind off...... the issue I have been having this whole time is because of the .htaccess file!! I could have sworn that was the first thing I got rid of, but I was wrong. Ok. Now. The issue I have is how am I supposed to set the .htaccess file the right way? Here is what I have:

    For wp-includes:
    Order Allow,Deny
    Deny from all
    <Files ~ ".(css|jpe?g|png|gif|js)$">
    <Files ~ ".(/themes/)$">
    Allow from all
    </Files>

    For wp-content:
    Order Allow,Deny
    Deny from all
    <Files ~ "\.(css|jpe?g|png|gif|js)$">
    Allow from all
    </Files>

    <Files ~ ".(/themes/)$">
    Allow from all
    </Files>

    I found out that if I delete these from my server, everything tends to work fine. However, as a security precaution, how do I edit this the right way.

  9. Otto
    Tech Ninja
    Posted 3 years ago #

    Why would you have those in the first place? They're not helpful nor do they make anything more secure. No wonder the site was broken.

    Delete them. Leave them off entirely. They can only do bad things, not helpful ones.

  10. nemo-maritime
    Member
    Posted 3 years ago #

    Really? Shoot, I thought I needed them. Ok, that is what I am looking to pass up then. I do however need it to be as secure as it can. But id doesnt really do much?

  11. Otto
    Tech Ninja
    Posted 3 years ago #

    The purpose of those is clearly to disallow browsers from pulling anything except certain types of files from those subdirectories. The problem is that all the WordPress files are safe to pull directly. They don't do anything dangerous. I understand the idea as a general precaution, but really, WP was designed to be secure in that respect, so there's nothing there that is dangerous.

  12. nemo-maritime
    Member
    Posted 3 years ago #

    Anything you would suggest? I have been to other users sites where it disallows access to the wp-content, wp-admin, and wp-includes folder for their site. Is that done with .htaccess?

  13. nemo-maritime
    Member
    Posted 3 years ago #

    Also, about the wp-config file, is that going to be an issue? Or can I just leave it the way it is?

  14. Otto
    Tech Ninja
    Posted 3 years ago #

    You don't need to disallow anything. It's fine the way it is. And wp-content is already blocked by default with that index.php file in there. And you can't block wp-admin, you kinda need to access that to do things on the site.

    Also, your wp-config file should not change at all during a upgrade, unless you're changing the secret keys.

  15. annicole72
    Member
    Posted 3 years ago #

    in 2.7 wp-config.php, there is a NONCE_KEY ... what is that? what do i put on there? it wasn't there in 2.6

  16. nemo-maritime
    Member
    Posted 3 years ago #

    @Otto42 Ok, the thing I had then was also about blocking the plugins page and wp-includes page. I went to your page, and this was blocked, how do you do this? How do you block acess. The admin I have blocked successfully, I just put a .htaccess in there not allowing anyone else in there except my home computers ip, no problems yet. How do I block access to those files though?

    @annicole72 - I was wondering that too. You need to go to the link that is given to you in the commented out text above that. It will gave a url you can go to and the page automatically loads a random, hard to guess code.
    EDIT - the link is http://api.wordpress.org/secret-key/1.1/

  17. Otto
    Tech Ninja
    Posted 3 years ago #

    nemo-maritime: You don't want to block access to those, because sometimes your site needs to get in there, into specific files. Some plugins do the same thing.

    If you mean how do I block the indexes, so that you can't see what plugins I actually have, then all you have to do is to add Options -Indexes to the top of your main .htaccess file.

  18. nemo-maritime
    Member
    Posted 3 years ago #

    Ok, sorry for being so paranoid and all, I might have read too many WP blog security articles, but I was just concerned that if I didnt block them off there could be a big security risk, and most of them said that wp-includes and wp-content should be blocked off. Just being cautious, dont want to be hacked I guess. But thank you for the code provided, that is the main thing I was looking for as when I visited your nice sites wp-includes and such files, it gave me an error. That is what I was looking for so I will try it soon. All I do is put the code you provided on the top of the main .htaccess? I think you pretty much addressed my concerns. Thank you for all of your help.

  19. nemo-maritime
    Member
    Posted 3 years ago #

    One more question. I had a blog I was updating from 2.5 to 2.7, do I just ignore the security key in there and get a new one for 2.7? Or am I supposed to use the one in 2.5

  20. Otto
    Tech Ninja
    Posted 3 years ago #

    You can replace the key's with new ones at any time. It won't affect anything, it will just make you "logged out" temporarily, until you log back in.

    Just go here: http://api.wordpress.org/secret-key/1.1/

    Then copy and paste that random set of keys into your wp-config file, replacing the old ones.

Topic Closed

This topic has been closed to new replies.

About this Topic