0

I am looking for a bit of helping in troubleshooting a website; it seems I cannot get into the WordPress Dashboard or use the book online function. It keeps throwing the following message

www.website.co.uk is currently unable to handle this request. HTTP ERROR 500

I have renamed the plugin folder to check if it was an issue with the plugins which didn't resolve my issue. The Apache and PHP version are below:

  • Apache Version 2.4.39
  • PHP Version 7.2.18

I have checked the PHP error log and found multiple errors such as:

[11-Apr-2017 11:56:28 UTC] PHP Fatal error: Namespace declaration statement has to be the very first statement in the script in /home/madeleyt/public_html/wp-content/plugins/appointment-booking/lib/Plugin.php on line 3`

I then renamed the plugin again which didn't fix anything.

Any ideas? TIA.

Martin
  • 22,212
  • 11
  • 70
  • 132
  • Can we have a bit of context about the bug, did the site break just like this, or was it after you changed something in the code / the admin section of Wordpress? If the latter, did you try to undo what you did? – Kaddath Jun 18 '19 at 09:05
  • 1
    Well your appointment-booking plugin seems to contain faulty code, so I’d try and physically remove that one specifically first of all. (Make a database backup before you try _anything_ though.) – 04FS Jun 18 '19 at 09:09
  • Something is above the namespace declaration in `/home/madeleyt/public_html/wp-content/plugin/appointment-booking/lib/Plugin.php`. Sanity check: turn off the plugin. – Martijn Jun 18 '19 at 09:44
  • As far as I am aware, this was caused from an update (friend's website; doesn't have much knowledge on what happened). – Elliot Dyson Jun 18 '19 at 10:09
  • 1
    Why does your error log have dates 2.5 years in the past? Are you debuging legacy code or something? – Martin Jun 18 '19 at 10:57
  • 1
    Possible duplicate of [Fatal error: Namespace declaration statement has to be the very first statement in the script in](https://stackoverflow.com/questions/21433086/fatal-error-namespace-declaration-statement-has-to-be-the-very-first-statement) – Martin Jun 18 '19 at 11:11

1 Answers1

0

From the error log, it is clear that the plugin appointment-booking is causing the issue. Try to deactivate it and the run the site. If still there is HTTP-500, check it on apache error log. The HTTP-500 is most probably due to, there is some programming error in the site.

Try to deactivate all plugins and activate them one by one and also check the error log simultaneously. If it fails to reproduce the issue, now try to switch the theme to any other default theme like twentysixteen etc. Hope it helps.

  • I have removed that plugin from the File Manager in cPanel but still no luck at the moment. – Elliot Dyson Jun 18 '19 at 11:50
  • Did you disabled all plugins? And switch the theme to any default theme? If both steps are followed , are you still seeing the 500 on the visit site? Also you can try to update the .htaccess file by clicking on save permalink button. Please share the error.log while you are seeing the 500. – Neeraj Krishna Maurya Jun 19 '19 at 10:34