Page 1 of 1

[solved] HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 5:18 am
by dragonfly-ie
Using oc v2.2.0.0. with php 7.2 for couple of years now without a bother. Default template. Nothing fancy.

Tried to search for a solution here and ended up down in 500+ rabbit holes ...

Can log into admin, but front page is blank: <head> and <body> empty.

In a nutshell:
1. Got unusual large number of customer's registrations with no details in DB.
2. Did a bit fiddling with >Modules >cookie notice by [...] - enabled/disabled
3. Changed >Customers >Custom Fields from tick to radio (to stop spam).

After this me website [...] went blank.

Got an old back up from May 23, but trying to avoid overwriting all files and losing changes, if possible?
And honestly not sure, if this is good decision?

Any insights or advice from community would be greatly appreciated? - Cheers

edit :: problem solved/ removed identifiable data

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 5:37 am
by halfhope
Hi!

Temporary add this lines into your .htaccess code to display startup errors:

Code: Select all

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on 

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 6:02 am
by JNeuhoff
Or just ask the webhost for the server's error log, for the time the 500 error occured.

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 2:48 pm
by khnaz35
Are you useing VPS or dedicated server? Or its a shared hosting ?

HTTP 500 Internal Server Error is a generic error message indicating a server-side problem, and the cause can be various issues such as:
Server misconfigurations: Issues in your server configuration files.
Resource limitations: Insufficient memory or other resource limitations.
Faulty PHP code: Errors in the PHP scripts of your application.
File permissions: Incorrect permissions on PHP scripts or other required files.
PHP extensions: Missing or incompatible PHP extensions.
.htaccess issues: Incorrect or misconfigured .htaccess files.

And so on. Instead of simply reverting the changes, I recommend investigating the underlying issue that is causing the error. You can do this on your own or feel free to reach out to me via email or forum message for assistance.

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 4:02 pm
by dragonfly-ie
Serves side seems to be ok, cause I have other URLs running perfectly.

IMO it's an php issue ...

My Error Log doesn't give much away, all I have is the following which occurred 3 days after error:500

2023-10-29 16:22:37 - PHP Unknown: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in ../system/storage/modification/catalog/model/catalog/product.php on line 56

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 4:05 pm
by khnaz35
dragonfly-ie wrote:
Thu Nov 02, 2023 4:02 pm
2023-10-29 16:22:37 - PHP Unknown: round(): Passing null to parameter #1 ($num) of type int|float is deprecated in ../system/storage/modification/catalog/model/catalog/product.php on line 56
Open the file from /system/storage/modification/catalog/model/catalog/product.php on line 56 and share here the block of code arround that line to understand why there is error.

Also what the php version and OC version you were using?

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 6:20 pm
by JNeuhoff
It looks like your webhost has upgraded your PHP version to 8.0 or later, without letting you know, judging by the error message!

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 7:09 pm
by dragonfly-ie
JNeuhoff wrote:
Thu Nov 02, 2023 6:20 pm
It looks like your webhost has upgraded your PHP version to 8.0 or later, without letting you know, judging by the error message!
Wouldn't it be nice, if it were this easy ... lol. - No, I pay extra for v7.2 support.

But thanks, maybe it's time to upgrade my OC version.

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 7:19 pm
by dragonfly-ie
khnaz35 wrote:
Thu Nov 02, 2023 4:05 pm
Open the file from /system/storage/modification/catalog/model/catalog/product.php on line 56 and share here the block of code arround that line to understand why there is error.
Here's the line 56
'rating' => round($query->row['rating']),

but like I mentioned before this error happened long AFTER site crash...

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 7:39 pm
by paulfeakins
dragonfly-ie wrote:
Thu Nov 02, 2023 7:19 pm

Code: Select all

'rating'           => round($query->row['rating']),
For some reason $query->row['rating'] is null so perhaps your database isn't returning a row for rating?

You might need a developer to take a look really.

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 7:50 pm
by dragonfly-ie
halfhope wrote:
Thu Nov 02, 2023 5:37 am
Hi!
Temporary add this lines into your .htaccess code to display startup errors:

Code: Select all

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on 
Thanks, mate. This is what I get:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 8:08 pm
by ADD Creative
As already been suggested, you would be best to ask your host for the server error log, if you don't see anything in the PHP or OpenCart error logs.

Re: HTTP error:500 (on front end)

Posted: Thu Nov 02, 2023 8:51 pm
by JNeuhoff
dragonfly-ie wrote:
Thu Nov 02, 2023 7:09 pm
JNeuhoff wrote:
Thu Nov 02, 2023 6:20 pm
It looks like your webhost has upgraded your PHP version to 8.0 or later, without letting you know, judging by the error message!
Wouldn't it be nice, if it were this easy ... lol. - No, I pay extra for v7.2 support.

But thanks, maybe it's time to upgrade my OC version.
You should check it. Just upload via FTP a little phpinfo.php script containing this:

Code: Select all

<?php phpinfo(); ?>
And then call it from your web browser, it will tell you all the PHP details, including the PHP version used.

Re: HTTP error:500 (on front end)

Posted: Fri Nov 03, 2023 8:10 pm
by paulfeakins
dragonfly-ie wrote:
Thu Nov 02, 2023 7:50 pm
halfhope wrote:
Thu Nov 02, 2023 5:37 am
Hi!
Temporary add this lines into your .htaccess code to display startup errors:

Code: Select all

php_flag display_startup_errors on
php_flag display_errors on
php_flag html_errors on 
Thanks, mate. This is what I get:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
That obviously hasn't worked as intended because that's a generic server error, not the actual error.

Re: [solved] HTTP error:500 (on front end)

Posted: Sun Nov 05, 2023 6:18 pm
by dragonfly-ie
My OC 2.2.x running on php7.2.36 was hacked through Custom Fields despite enabled Captcha.

I would advise anybody to avoid this feature >Customers >Custom Fields

HTH.

Re: [solved] HTTP error:500 (on front end)

Posted: Sun Nov 05, 2023 8:36 pm
by ADD Creative
dragonfly-ie wrote:
Sun Nov 05, 2023 6:18 pm
My OC 2.2.x running on php7.2.36 was hacked through Custom Fields despite enabled Captcha.

I would advise anybody to avoid this feature >Customers >Custom Fields

HTH.
How was your site attacked? Was it just a bot creating customer accounts or something else?

Re: [solved] HTTP error:500 (on front end)

Posted: Sun Nov 05, 2023 10:31 pm
by dragonfly-ie
Seems like they were humans. >:D

Hard to say. Just an uneducated guess, because I disabled Custom Fields a couple of weeks ago, and still kept getting sign-ups with Custom Fields showing in registration, which was very strange , to say the least.