php selector error 500

Started by Dumnezeu, May 20, 2023, 02:48:04 PM

Previous topic - Next topic

Dumnezeu

After clean install cwp pro (twice) i get the same error when trying to use php74 via php selector.

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

Please contact the server administrator at admin@gdsys.ro 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 go to server error log and i got this:

[Sat May 20 17:27:53.069507 2023] [:error] [pid 14289:tid 140339180427008] [client 86.126.162.245:47286] SecurityException in Application.cpp:498: Handler not found in configuration
[Sat May 20 17:27:53.069755 2023] [:error] [pid 14289:tid 140339180427008] [client 86.126.162.245:47286] Caused by KeyNotFoundException in Configuration.cpp:241: Handler "application/x-httpd-php74" not found
[Sat May 20 17:27:53.069789 2023] [core:error] [pid 14289:tid 140339180427008] [client 86.126.162.245:47286] End of script output before headers: info.php


From this error i understain theat the php version is not installed but it is ... i did installed and reinstalled many times also i did reinstall the whole system just to be sure.
Also if i go to php selector under phpinfo o got all info about the php version.

All other php version work fine.

cyberspace

Look at this error:

Handler "application/x-httpd-php74" not found

In case you use Apache (PHP-FPM/suPHP) / Nginx+Apache (PHP-FPM/suPHP) then I recommend you do following:

(I suppose you have PHP 7.3 installed)
grep "application/x-httpd-php73" /usr/local/apache/conf* -Rl
and then investigate the records associated with "application/x-httpd-php73" in the files listed by "grep". Check if the files have the similar records for "application/x-httpd-php74", add the necessary lines and restart apache/php-fpm.

Dumnezeu

Quote from: cyberspace on May 21, 2023, 03:26:42 PM
Look at this error:

Handler "application/x-httpd-php74" not found

In case you use Apache (PHP-FPM/suPHP) / Nginx+Apache (PHP-FPM/suPHP) then I recommend you do following:

(I suppose you have PHP 7.3 installed)
grep "application/x-httpd-php73" /usr/local/apache/conf* -Rl
and then investigate the records associated with "application/x-httpd-php73" in the files listed by "grep". Check if the files have the similar records for "application/x-httpd-php74", add the necessary lines and restart apache/php-fpm.
It does'm matter what tipe of server i use the problem is still there . Thank for your recomandation  ... i did not find anythink suspect.

yogisparingga

i got same this eror, if i activate php 7.4, so i got error 500 internal server error
i use cwp pro for activate php selector.

halo admin, can u give answer for this problem?


studio4host

run this script
/scripts/cpanel_addhandlers
VPS & Dedicated server provider with included FREE Managed support for CWP.
http://www.studio4host.com/

*** Don't allow that your server or website is down, choose hosting provider with included expert managed support for your CWP.

Dumnezeu

Quote from: studio4host on May 25, 2023, 05:46:42 AM
run this script
/scripts/cpanel_addhandlers
Your response solved my problem with php 74.
Thank you !

emerysteele

I am getting this same error on a new server. Running '/scripts/cpanel_addhandlers' is not fixing it. Any other suggestions?

overseer

Are you running PHP in CGI mode or php-fpm?

emerysteele


emerysteele

#9
Fixed my problem. My '/usr/local/etc/suphp.conf' file was missing the line for the php74 handler. Just had to add it & restart apache:

application/x-httpd-php74="php:/opt/alt/php74/usr/bin/php-cgi"

I think /scripts/cpanel_addhandlers is supposed to add this, but the code appears to be missing for php74 on my server
        if [[ -z `grep x-httpd-php73 /usr/local/etc/suphp.conf` ]];then
                echo "application/x-httpd-php73=\"php:/opt/alt/php73/usr/bin/php-cgi\"" >> /usr/local/etc/suphp.conf
        fi

        if [[ -z `grep x-httpd-php80 /usr/local/etc/suphp.conf` ]];then
                echo "application/x-httpd-php80=\"php:/opt/alt/php80/usr/bin/php-cgi\"" >> /usr/local/etc/suphp.conf
        fi

Alex6

Quote from: emerysteele on May 30, 2023, 03:35:42 PM
Fixed my problem. My '/usr/local/etc/suphp.conf' file was missing the line for the php74 handler. Just had to add it & restart apache:

application/x-httpd-php74="php:/opt/alt/php74/usr/bin/php-cgi"

I think /scripts/cpanel_addhandlers is supposed to add this, but the code appears to be missing for php74 on my server
        if [[ -z `grep x-httpd-php73 /usr/local/etc/suphp.conf` ]];then
                echo "application/x-httpd-php73=\"php:/opt/alt/php73/usr/bin/php-cgi\"" >> /usr/local/etc/suphp.conf
        fi

        if [[ -z `grep x-httpd-php80 /usr/local/etc/suphp.conf` ]];then
                echo "application/x-httpd-php80=\"php:/opt/alt/php80/usr/bin/php-cgi\"" >> /usr/local/etc/suphp.conf
        fi


Thank you, it solved my problem !
Execute /scripts/cpanel_addhandlers changed nothing, but add these lines in usr/local/etc/suphp.conf works (PHP 7.3 => PHP 7.4)