Control Web Panel

WebPanel => PHP Selector => Topic started by: Dumnezeu on May 20, 2023, 02:48:04 PM

Title: php selector error 500
Post by: Dumnezeu on May 20, 2023, 02:48:04 PM
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:
Code: [Select]
[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.
Title: Re: php selector error 500
Post by: cyberspace on May 21, 2023, 03:26:42 PM
Look at this error:

Code: [Select]
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)
Code: [Select]
grep "application/x-httpd-php73" /usr/local/apache/conf* -Rland 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.
Title: Re: php selector error 500
Post by: Dumnezeu on May 22, 2023, 11:20:05 PM
Look at this error:

Code: [Select]
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)
Code: [Select]
grep "application/x-httpd-php73" /usr/local/apache/conf* -Rland 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.
Title: Re: php selector error 500
Post by: yogisparingga on May 24, 2023, 02:21:57 PM
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?

(https://i.ibb.co/686DPm7/image.png)
Title: Re: php selector error 500
Post by: studio4host on May 25, 2023, 05:46:42 AM
run this script
Code: [Select]
/scripts/cpanel_addhandlers
Title: Re: php selector error 500
Post by: Dumnezeu on May 26, 2023, 12:48:30 AM
run this script
Code: [Select]
/scripts/cpanel_addhandlers
Your response solved my problem with php 74.
Thank you !
Title: Re: php selector error 500
Post by: emerysteele on May 30, 2023, 03:50:13 AM
I am getting this same error on a new server. Running '/scripts/cpanel_addhandlers' is not fixing it. Any other suggestions?
Title: Re: php selector error 500
Post by: overseer on May 30, 2023, 04:29:01 AM
Are you running PHP in CGI mode or php-fpm?
Title: Re: php selector error 500
Post by: emerysteele on May 30, 2023, 05:57:19 AM
Are you running PHP in CGI mode or php-fpm?

cgi
Title: Re: php selector error 500
Post by: 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:

Code: [Select]
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
Code: [Select]
        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
Title: Re: php selector error 500
Post by: Alex6 on January 15, 2024, 05:36:55 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:

Code: [Select]
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
Code: [Select]
        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)