Author Topic: php selector error 500  (Read 2768 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
php selector error 500
« 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.
« Last Edit: May 20, 2023, 02:58:01 PM by Dumnezeu »

Offline
*
Re: php selector error 500
« Reply #1 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.

Offline
*
Re: php selector error 500
« Reply #2 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.

Offline
*
Re: php selector error 500
« Reply #3 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?


Offline
*
Re: php selector error 500
« Reply #4 on: May 25, 2023, 05:46:42 AM »
run this script
Code: [Select]
/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.

Offline
*
Re: php selector error 500
« Reply #5 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 !

Offline
*
Re: php selector error 500
« Reply #6 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?

Offline
****
Re: php selector error 500
« Reply #7 on: May 30, 2023, 04:29:01 AM »
Are you running PHP in CGI mode or php-fpm?

Offline
*
Re: php selector error 500
« Reply #8 on: May 30, 2023, 05:57:19 AM »
Are you running PHP in CGI mode or php-fpm?

cgi

Offline
*
Re: php selector error 500
« Reply #9 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
« Last Edit: May 30, 2023, 03:39:40 PM by emerysteele »

Offline
*
Re: php selector error 500
« Reply #10 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)