This Help forum is for issues relates to the latest release (1.7.9). For issues related to beta or github version please use their own Help forum.
Before asking for help please read "How to request help" by clicking on that tab above here."

TOPIC: Fatal Error

Fatal Error 2 months 3 days ago #1

  • ksajdak
  • ksajdak's Avatar
  • Offline
  • New
  • Posts: 42
My site running 1.7.9 has come up with this error:

Fatal error: Namespace declaration statement has to be the very first statement or after any declare call in the script in C:\home\site\wwwroot\family\index.php on line 23

Help?
The administrator has disabled public write access.

Fatal Error 2 months 3 days ago #2

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10339
This is what the file index.php should look like:

github.com/fisharebest/webtrees/blob/1.7.9/index.php

Your error message suggests that some additional code has been inserted at the beginning.
This can often indicate that your server has been hacked.

Examine this file on your server, and compare with the link.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.

Fatal Error 2 months 1 day ago #3

  • ksajdak
  • ksajdak's Avatar
  • Offline
  • New
  • Posts: 42
OK, so here's what I did . . . still getting same error.

I re-uploaded a version of index.php from a backup I did when it was working.
The administrator has disabled public write access.

Fatal Error 2 months 1 day ago #4

  • fisharebest
  • fisharebest's Avatar
  • Offline
  • Administrator
  • Posts: 10339
Your error says that the "namespace" statement on line 23 must be the first statement in the file.

If you look at the file that I linked, you'll see that "namespace" occurs on line 16.

This tells me that you have an extra 7 lines of code at the start your file.

My guess is that your site has been hacked, and that some malware has inserted it into the file.

> I re-uploaded a version of index.php

It is quite possible that you uploaded a clean version of the file, which was overwritten by the malware. Often this type of malware inserts itself into every .PHP script that it can find.

To confirm this, you need to compare the file on your server with the one in my link.

Or you could just copy it from the server (using FTP) and email it to me.
Greg Roach - This email address is being protected from spambots. You need JavaScript enabled to view it. - fisharebest.webtrees.net
The administrator has disabled public write access.
Powered by Kunena Forum