Author Topic: PHP 7.4 - 500 server error  (Read 1637 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
PHP 7.4 - 500 server error
« on: November 27, 2022, 04:45:29 AM »
I have rebuilt PHP, twice, via PHP Selector but I cannot use PHP 7.4.x. If I add the following to .htaccess, I get 500 server error:

Code: [Select]
AddHandler application/x-httpd-php74 .php
I get the following in the Apache error log:
Code: [Select]
[Sat Nov 26 21:59:04.995013 2022] [:error] [pid 31607:tid 139976842884864] [client 33.123.248.25:0] SecurityException in Application.cpp:498: Handler not found in configuration, referer: https://mysite/test
[Sat Nov 26 21:59:04.995495 2022] [:error] [pid 31607:tid 139976842884864] [client 33.123.248.25:0] Caused by KeyNotFoundException in Configuration.cpp:241: Handler "application/x-httpd-php74" not found, referer: https://mysite/test
[Sat Nov 26 21:59:04.995535 2022] [core:error] [pid 31607:tid 139976842884864] [client 33.123.248.25:0] End of script output before headers: yourls-loader.php, referer: https://mysite/test

I also have PHP 7.3, PHP 8.0 and PHP 8.1 installed and all three work if I use AddHandler application/x-httpd-php73 or 80 or 81 .php in .htaccess.

This issue seems to be specific to PHP 7.4.

Anyone else encounter this? How do I fix?
« Last Edit: November 27, 2022, 05:17:11 AM by jeffshead »

Offline
*
Re: PHP 7.4 - 500 server error
« Reply #1 on: November 27, 2022, 12:21:39 PM »
Code: [Select]
[root@cwp ~]# tail -f /var/log/php-selector-rebuild.log
Don't forget to run 'make test'.

Installing shared extensions:     /opt/alt/php74/usr/lib/php/extensions/no-debug-non-zts-20190902/
Creating config file

Build Completed
###################


Error:Can't add notification!


Full log:
https://pastebin.pl/view/raw/cd53102c
« Last Edit: November 27, 2022, 12:46:30 PM by jeffshead »

Offline
****
Re: PHP 7.4 - 500 server error
« Reply #2 on: November 27, 2022, 08:05:13 PM »
I've found that CWP needs to have PHP built thru the control panel.
Any deviation from this will break things.

To try & fix you 500 Error, goto: User Accounts -> Fix Permissions

Select your user, then check off 'Fix Permissions' and "Internal Server Error'.

If that doesn't work retry with all 3 checked, including 'Remove AddHandler'

CWP uses PHP 7.1 as Default for some reason.

--

Found this interesting article when Googled:
https://serverfault.com/questions/806879/addhandler-for-php-with-different-file-extension

Offline
*
Re: PHP 7.4 - 500 server error
« Reply #3 on: November 27, 2022, 09:05:57 PM »
@Starburst
Thanks for the suggestions but this is not a permissions issue. I can build and use PHP 7.3, 8.0 and 8.1 using the PHP Selector in the CWP admin. When I build PHP 7.4 in the PHP Selector, it builds it but I get 500 server errors.

With that said, I did try your suggestions but they made no difference.

As another test, I updated the root PHP from 7.3 to 7.4 using the PHP Switcher in the CWP Control Panel. Now I have a working version of PHP 7.4 but PHP 7.4 in the PHP Selector still does not work. I still get 500 server errors when I add AddHandler application/x-httpd-php74 .php to any .htaccess file, on any domain. So it does seem to be something specific to PHP Selector.
« Last Edit: November 27, 2022, 09:47:35 PM by jeffshead »