Error while trying to configure PHP directives to access error logs

Error Message

Error please try again

Other

When I try to change PHP directives an error is thrown. The error shows up even if I leave the settings untouched.
I am trying to change Display Errors from Off to On to be able to see why my website returns a 500 error code. So, the settings I tried to change to were:
Display Errors: On
MB String Input: auto
PHP Timezone: America/New York
Unfortunately, I could not find a way to make this change succeed so I would be glad if someone could help me.

It seems like there is some issue with the Alter PHP Config tool. In the meanwhile please add this code on the .htaccess file you need to create in the htdocs folder:

php_flag display_errors On
3 Likes

I have already added it… it shows me a message to enable display errors on my cpanel.

I added php_flag display_errors = on so I changed now to php_flag display_errors On and it returns a 500 error and no error message.

Where are the logs supposed to be?

What type is that 500 error? is it being redirected to a page of infinityfree.net? or a page showing that your site cannot be opened?

The code @Ergastolator1 mentioned can enable display errors if you’ve configured it correctly.

My website: http://ducks0ci3ty.ga
My .htaccess file:

Options -Indexes
ServerSignature Off

ErrorDocument 403 /index.php
ErrorDocument 404 /index.php

php_flag display_errors On

AddDefaultCharset utf-8

<IfModule mod_rewrite.c>
	RewriteEngine On
	RewriteBase /

	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule . /index.php [L]

	RewriteRule ^\@import - [F,NC]
</IfModule>

It should be at top of htaccess file.

The result is the same…

Which exact page is generating the error response? I just clicked through http://ducks0ci3ty.ga/ and all the pages are working fine for me.

3 Likes

Wait what, 9 hours ago clicked his site and it showed up as Error 500. I think he has fixed it for now.

2 Likes

I just switched the hosting provider. It looked like my php files were probably using blacklisted infinityfree php functions because when I tried another hosting platform the website did not return any error. Anyway, thanks for the support

Just to let you know I (and many others) am happy to help you fix this if you give me the chance.

I am happy to hear that. I prefer infinityfree hosting so I will set up a subdomain so that you can help me getting rid of the 500 error.

2 Likes

So, the new website is http://duckctf.epizy.com
I enabled display_errors but the result is the same.
Note that the error it shows is not a critical one and it does not cause the 500 error.
(I removed the error in my old website and the error persisted)

It shows this deprecation error:

Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/vol4_3/epizy.com/epiz_26430492/htdocs/@import/init.php on line 58

So it may be a problem with your software not working well on PHP 7.4, which is the latest version of PHP available. Maybe your software should be updated to the latest version or the PHP version should be downgraded to PHP 5.6 (even though the latter is not recommended because PHP 5 does not receive security updates anymore) in order for the deprecation to be gone and your website to work fine again.

1 Like

The software I am using supports only PHP >= 7.3
Also, I have a local VM with apache2 and php 7.4 (with mod rewrite, sqlite3 and mbstrings installed) and it works fine. It also works fine with wamp under windows and even with freehostingnoads 7.3.20/7.4 php version.

I just poked through your software, and one of the first lines in the @import/init.php script is as follows:

ini_set('display_errors', 'off');

So it’s not surprising you don’t see any error messages: your software forcibly blocks displaying it. If you comment out this line, or change the value to on, and then refresh the page, you may see the actual error message.

3 Likes

Thank you! That solved the problem, it looked like my sqlite file was corrupted, but now the website is running.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.