Support » Installing WordPress » Reinstallation failed – error in wp-config.php

  • Hi there,

    I wonder if anyone can help me with this problem.

    I attempted an automatic upgrade of WordPress via the dashboard which failed during the database update.

    I then uninstalled WordPress via my hosting provider and re-installed (V. 3.3.1) it again from there and then tried copying my backup of the site from my hard drive over.

    I modified wp-config.php to specify the new MySQL settings and copied it across.

    Now when I try to access the site I get the following error:

    Parse error: syntax error, unexpected $end in /homez.514/irishtre/www/wp-config.php on line 1

    I didn’t touch line 1, which contains <?php, as it should.

    Is there anything I am missing?

    Thank you.

Viewing 11 replies - 1 through 11 (of 11 total)
  • esmi


    Forum Moderator

    How exactly did you edit the wp-config.php file? What text editor did you use? You may have inadvertently added a non-printable character to the top of the file.

    Using Notepad++ esmi.



    Forum Moderator

    That should be fine. The only thing I can suggest is that you try re-creating the file again from wp-config-sample.php.

    However, do check the format that the file is being saved in. I don’t use Notepad++ myself but in my text editor (TextPad), I can save files in PC, Mac or Unix format. On a *nix server, I always use the Unix format. Also check that you are uploading the file in ASCII mode in your FTP client. If it’s being uploaded as binary, that could also screw things up.

    Many thanks esmi. The transfer and the format are correct.

    I’ll follow your advice and try to re-create the file again.

    Interesting. I re-created wp-config.php from the sample and now I’m getting this:

    Fatal error: Call to undefined function add_custom_background() in /homez.514/irishtre/www/wp-content/themes/twentyten/functions.php on line 104

    So getting a bit further, but I’m not sure what to do about this one!



    Forum Moderator

    It’s beginning to sound like something has corrupted files generally. Did you notice any problems when uploading by FTP? Was the upload process stopping or starting? Or running very slow?

    Try re-uploading all files & folders – except the wp-content folder – from a fresh download of WordPress.

    I think you are spot on. I did notice slowness and pauses in the FTP.

    When you say fresh download – would it be ok to use the WordPress installation module provided by my hosting service, having deleted the one there now?

    Or should I just bite the bullet and do it all myself?

    I have never installed WordPress manually that’s all.



    Forum Moderator

    If you can possibly manage, I’d recommend a manual install. Most of the time 1-click installers are great but, here, we do notice significantly more problems after using them compared to manual installs.

    Well I’ll split the difference.

    I’ll do a 1 click first and then if that does not work I’ll head for the coalface. It will be a useful exercise to learn a manual install anyway.

    Thank you so much for your help. I’ll let you know how I get on!

    Thank you Eric.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Reinstallation failed – error in wp-config.php’ is closed to new replies.