Score:0

How do i install php 8 without php-fpm and nginx modules?

es flag

I am trying to install Apache2 + PHP 8.1 in a fresh install of a Centos 8.5 server.

This is my server setup:

[centos@api-stg html]$ cat /etc/*elease
CentOS Stream release 8
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
CentOS Stream release 8
CentOS Stream release 8

I was following this tutorial, but when I got to the sudo dnf install php php-mysqlnd command I got the following to be installed:

Last metadata expiration check: 0:37:22 ago on Tue 08 Mar 2022 09:47:48 AM -05.
Dependencies resolved.
===============================================================================================================================================================================
 Package                                Architecture                 Version                                                          Repository                          Size
===============================================================================================================================================================================
Installing:
 php                                    x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       1.7 M
 php-cli                                x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       5.3 M
 php-common                             x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       1.2 M
Installing dependencies:
 libsodium                              x86_64                       1.0.18-2.el8                                                     epel                               162 k
 oniguruma5php                          x86_64                       6.9.7.1-1.el8.remi                                               remi-safe                          210 k
Installing weak dependencies:
 nginx-filesystem                       noarch                       1:1.14.1-9.module_el8.0.0+1060+3ab382d3                          appstream                           24 k
 php-fpm                                x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       1.8 M
 php-mbstring                           x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       520 k
 php-opcache                            x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       627 k
 php-pdo                                x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       161 k
 php-sodium                             x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       101 k
 php-xml                                x86_64                       8.1.3-1.el8.remi                                                 remi-modular                       251 k
Enabling module streams:
 nginx                                                               1.14

Transaction Summary
===============================================================================================================================================================================
Install  12 Packages

Now, I don't want anything related to Nginx or php-fpm, is there a way to exclude those from my setup?

Score:0
jp flag

Now, I don't want anything related to Nginx or php-fpm, is there a way to exclude those from my setup?

On CentOS >= 8, to enable PHP you NEED php-fpm. httpd is configured to use FastCGI (provided by php-fpm) using mod_proxy.

In above transaction, nginx is NOT installed (only nginx-filesystem which only owns a few directories for configuration files).

Installing httpd and php-fpm, and starting the services, and everything will work as expected.

P.S. It is still possible to use mod_php on C8 (so without php-fpm), but this is not recommended, and imply to switch httpd to prefork mode (which is bad for performance and security). It is not possible anymore on C9.

es flag
I did the install with fpm and now the server won't load PHP. I am getting a 503 error that doesn't explain much. `"GET /index.php HTTP/1.1" 503 299 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36"`
Remi Collet avatar
jp flag
check the log... /var/log/httpd and /var/log/php-fpm
Remi Collet avatar
jp flag
as start with a simple test page: `<?php phpinfo(); ?>`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.