Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Server Error (error 500) #24

Open
aldemarcalazans opened this issue Jan 24, 2025 · 8 comments
Open

Internal Server Error (error 500) #24

aldemarcalazans opened this issue Jan 24, 2025 · 8 comments
Labels
Milestone

Comments

@aldemarcalazans
Copy link

aldemarcalazans commented Jan 24, 2025

I used this software with Apache 2.4.6 and PHP 7.1, in CentOS 7 and it worked perfectly. However, I have tried to use it with Apache 2.4.37 and PHP 7.2, in Alma Linux 8, and it does not work, giving me the following error message:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at root@localhost 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.

I found out that it occurs due the use of "php_flag" and "php_value" in .htaccess file, as described here: https://stackoverflow.com/questions/22858889/use-php-flag-in-htaccess. If I comment the .htaccess file, the error disappears

So, I ask you: is it possible to transfer these instructions to the script bench.php, using the function ini_set() ?

Regards,
Aldemar Calazans Filho

@sergey-dryabzhinsky
Copy link
Member

Any particular line or all?

@sergey-dryabzhinsky
Copy link
Member

Maybe some of those params changed visibility in 7.2

@aldemarcalazans
Copy link
Author

The Apache server error log told me that "php_flag" was an ilegal instruction, so I believe that this instruction was not automatically enabled, as it used to be in the older version of this distro.

So, I guess that removing these instructions from .htaccess will turn this script more compatible with similar systems, where php_flag and php_value are disab led in Apache.

@sergey-dryabzhinsky
Copy link
Member

Do you use mod_php or cgi?

@aldemarcalazans
Copy link
Author

I use mod_php.

@sergey-dryabzhinsky
Copy link
Member

sergey-dryabzhinsky commented Jan 28, 2025

Strange, but you are right. There might be similar situations on other hostings. Need to move these fllags to separate php file and include it.

@aldemarcalazans
Copy link
Author

aldemarcalazans commented Jan 28, 2025

Hi, I was wrong about the functioning of PHP 7.2 in Alma Linux 8: I looked at phpinfo, and it does not show mod_php as a module loaded. As follows:

• In CentOS 7 with PHP 5.6, we have Apache 2.0 Handler as the SERVER API and mod_php5 as a loaded module.
• In CentOS 7 with PHP 7.1, we have Apache 2.0 Handler as the SERVER API and mod_php7 as a loaded module.
• In Alma Linux 8 with PHP 7.2, we have FPM/FatsCGI as the SERVER API, and no reference to mod_php.
• In Alma Linux 8 with PHP 7.3, we have FPM/FatsCGI as the SERVER API, and no reference to mod_php.

So, as of PHP 7.2, I guess CGI is the default in RHEL like distros. And the script, as it is, will fail.

@sergey-dryabzhinsky
Copy link
Member

That makes sense.

@sergey-dryabzhinsky sergey-dryabzhinsky added this to the 1.0.58 milestone Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants