php install help with apache

Issues related to applications and software problems and general support
1885
Posts: 139
Joined: 2014/10/25 13:33:03

php install help with apache

Post by 1885 » 2019/11/26 13:28:02

Trying to install php7.2 with apache2 and I get
Unable to match profile in argument php:7.2/default
Using this tutorial:
https://linuxconfig.org/how-to-install-php-on-redhat-8

Thank You!

Code: Select all

dnf module list php
Last metadata expiration check: 0:12:24 ago on Tue 26 Nov 2019 05:12:45 AM PST.
CentOS-8 - AppStream
Name                                Stream                                   Profiles                                                     Summary                                             
php                                 7.2 [d][e]                               common [d] [i], devel, minimal                               PHP scripting language                              

Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled


I'm trying to install the module

Code: Select all

# dnf module install php:7.2/default
Last metadata expiration check: 0:13:32 ago on Tue 26 Nov 2019 05:12:45 AM PST.
Unable to match profile in argument php:7.2/default
Error: Problems in request:
missing groups or modules: php:7.2/default



User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: php install help with apache

Post by remirepo » 2019/11/26 13:35:48

> php 7.2 [d][e] common [d] , devel, minimal PHP scripting language

As you see in the output there is no "default" profile, but a "common" one (which can be omitted, like the version, which is the default)

[d] means default...

Code: Select all

dnf module install php
dnf module install php:7.2/common

P.S. referenced howto seems outdated, probably written at 8.0-Beta time
Remi's Repository - Forum - Blog

1885
Posts: 139
Joined: 2014/10/25 13:33:03

Re: php install help with apache

Post by 1885 » 2019/11/26 14:47:32

thank you!

Now to figure out how to enable php with apache2
my test.php did not work.
My assumption is I need to add php to httpd.conf

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: php install help with apache

Post by remirepo » 2019/11/26 15:31:41

By default, php-fpm will be used to served the requests and provides the needed configuration files for httpd and nginx, and both should work out of the box.
Remi's Repository - Forum - Blog

1885
Posts: 139
Joined: 2014/10/25 13:33:03

Re: php install help with apache

Post by 1885 » 2019/11/27 12:38:35

Thank you! /var/www/html works with <?php phpinfo();?>
Now to virtual host!
Note:
test.php with <?php phpinfo();?>
does not work at ~/http with a normal linux user.
VirtualHost was setup and works but php does not work in that directory.
Last edited by 1885 on 2019/11/27 14:37:18, edited 1 time in total.

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: php install help with apache

Post by remirepo » 2019/11/27 12:47:52

1885 wrote:
2019/11/27 12:38:35
How to virtual host!
Exactly like in previous versions.
http://httpd.apache.org/docs/2.4/en/vhosts/
Remi's Repository - Forum - Blog

BShT
Posts: 585
Joined: 2019/10/09 12:31:40

Re: php install help with apache

Post by BShT » 2019/11/27 12:49:28

if you don´t want php-fpm take a look at /etc/httpd/conf.modules.d/00-mpm.conf

1885
Posts: 139
Joined: 2014/10/25 13:33:03

Re: php install help with apache

Post by 1885 » 2019/11/28 14:40:25

I'm having some trouble with virtual hosts and php
html works fine with virtualhosts

~/http works if it is not a virtual host

I needed to start php and httpd both
systemctl restart httpd.service
systemctl restart php-fpm.service

Thanks again for the posts

BShT
Posts: 585
Joined: 2019/10/09 12:31:40

Re: php install help with apache

Post by BShT » 2019/11/28 14:49:52

php-fpm process php out of http server, apache or nginx.

that´s why you have to restart httpd (apache) and php-fpm

if you want to use legacy mod_php take a look at my first post

mod_php works under apache context

User avatar
remirepo
Posts: 447
Joined: 2014/09/21 09:07:12
Location: France
Contact:

Re: php install help with apache

Post by remirepo » 2019/11/28 15:29:26

> if you don´t want php-fpm take a look at /etc/httpd/conf.modules.d/00-mpm.conf

FPM is now the default provided configuration for good reasons.

Yes, you still can use old deprecated mod_php
If you like to keep leaving in the previous century, with less security and less performance.
Remi's Repository - Forum - Blog

Post Reply