This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

dab69574
dab69574

Total newbie here, I'm flopping about like a fish on the deck cause I just broke my new 2.1.22 build. Now every page previews like this:

Error We're sorry, but an unhandled error occurred. Please see the details below. Namespace declaration statement has to be the very first statement or after any declare call in the script ~/modules/media/classes/MediaLibrary.php line 1 Type Undefined Exception Symfony\Component\Debug\Exception\FatalErrorException

The first line of the file is <?php so I think it's prior to this where it's breaking. My shared webhost has an ongoing infection of malware that I keep scrubbed every hour. My scrubber deletes all index.php files and backs up the ones I know about from copies. Usually apps in my domains have one index.php in their root folder. So maybe an essential index.php file that I didn't notice got deleted? But my october install worked for weeks with no problem. Is there a terminal command using php artisan that can refresh my install? I had to install it from scratch because the Softaculous cpanel installer still uses version 1.0.472. Is there an install script now for ver 2.1? Thanks so much for this amazing product and have a great day!

daftspunky
daftspunky

Hi dab,

This would appear that the core files have been modified and are corrupt, the PHP complains of this (code appearing before the namespace). October only has one index.php file and in this case the file ~/modules/media/classes/MediaLibrary.php has been modified.

This is indeed a difficult situation for hosting a website. However, you can restore the files using composer with the following:

composer clearcache
rm -rf modules/
rm -rf vendor/
composer install

I hope this helps.

Last updated

daftspunky
daftspunky

Also, it may be worthwhile reading the documentation regarding shared hosting and file permissions.

dab69574
dab69574

Thanks so much, that worked like a charm. I have one other index.php file in ./vendor/symfony/http-client-contracts/Test/Fixtures/web/index.php It looks legit so I will include it in my rewrite routine after it's erased every hour. I don't know how the bad people are getting in, but when they do manage to implant their short lived malware, they go a facebook page of mine and like it to show what successful hackers they are. Weird. Thanks again!

1-4 of 4

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.