NGINX UNIT "PHP" application is not supported on RHEL 9 #1302
Replies: 2 comments 2 replies
-
If you have Drupal 10.2 or 10.3 that should work with php 8.3, otherwise I expect you may need to build the unit-php module from source. Caveat Emptor... as usual... You'll need to install the php 8.1-devel package and perhaps the php 8.1-embedded package if it isn't already. You'll also need to grab the unit source and build the php language module, something along the lines of... $ git clone https://github.com/nginx/unit.git
$ cd unit
$ git checkout -b 1.32.1
$ ./configure # shouldn't need to specify the various paths etc as we're only going to copy out the php language module
$ make -j4
$ ./configure php # If that fails you may need to specify --config to point to the appropriate php-config file for your php 8.1 e.g './configure php --config=/path/to/php81-config'
$ make
# cp build/lib/unit/modules/php.unit.so /usr/lib64/unit/modules/ Restart Unit and it should pick up your newly built module, it will simply be called |
Beta Was this translation helpful? Give feedback.
-
Yeah rebuilt PHP 8.1 per steps above and restarted unit but still get the same error I think I'll go back to NGINX for now. Thanks for your help |
Beta Was this translation helpful? Give feedback.
-
We are running Drupal 10 which requires PHP8.1. Recently the University has given me a RHEL 9 Box so I am busy porting our websites over.
In the course of things I thought it would be a good idea to upgrade NGINX to UNIT but I cannot configure a PHP app in the UNIT configuration without a PHP error;
I've tried the generic "php" and specifying the version "php 8.1.27"
cat unit.json.conf | curl -X PUT -d@- localhost:8000/config
{
"error": "Invalid configuration.",
"detail": "The module to run "php 8.1.27" is not found among the available application modules."
}
[root@jbidevlin03 jbi]# php --version
PHP 8.1.27 (cli) (built: Dec 19 2023 20:35:55) (NTS gcc x86_64)
Copyright (c) The PHP Group
Zend Engine v4.1.27, Copyright (c) Zend Technologies
[root@jbidevlin03 jbi]# rmate unit.json.conf
[root@jbidevlin03 jbi]# cat unit.json.conf | curl -X PUT -d@- localhost:8000/config
{
"error": "Invalid configuration.",
"detail": "The module to run "php" is not found among the available application modules."
}
UNIT installation requires "yum install unit-php"
but I get this error;
yum install unit-php
Updating Subscription Management repositories.
Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) 157 kB/s | 4.1 kB 00:00
remi-rhel9-x86_64 47 kB/s | 1.5 kB 00:00
uofa_local_rhel9 94 kB/s | 1.5 kB 00:00
Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) 113 kB/s | 2.9 kB 00:00
epel-rhel9-x86_64 131 kB/s | 2.3 kB 00:00
Red Hat Satellite Client 6 for RHEL 9 x86_64 (RPMs) 152 kB/s | 3.8 kB 00:00
No match for argument: unit-php
Error: Unable to find a match: unit-php
So I have decided to go back to vanilla NGNIX unless someone can advise me how to fix this?
Thanks in advance
Mike M
Beta Was this translation helpful? Give feedback.
All reactions