Page 1 of 1

Remove PHP by accident

Posted: Sat Jan 11, 2020 5:23 am
by Loc_rabbirt
I tried upgrade my server to PHP 7.x and I tried follow an article from sever mom. In their step, it mentioned to remove php and now I'm unable to install or re-activate php again.

1. I tried use:

Code: Select all

yum --enablerepo=remi-php70 install php70-php php70-php-pear php70-php-bcmath php70-php-pecl-jsond-devel php70-php-mysqlnd php70-php-gd php70-php-common php70-php-fpm php70-php-intl php70-php-cli php70-php php70-php-xml php70-php-opcache php70-php-pecl-apcu php70-php-pecl-jsond php70-php-pdo php70-php-gmp php70-php-process php70-php-pecl-imagick php70-php-devel php70-php-mbstring
But no luck

2. I got this problem when I tried restart httpd

Code: Select all

[warn] module ruid2_module is already loaded, skipping
Syntax error on line 17 of /home/admin/conf/web/httpd.conf:
Invalid command 'php_admin_value', perhaps misspelled or defined by a module not included in the server configuration
I hope get some hints to resolve it, thank you for all your help!

Re: Remove PHP by accident

Posted: Wed Jan 15, 2020 2:21 pm
by Loc_rabbirt
I think I know what is problem now, but I'm not sure how to resolve it.

My server work with centos 6 and seem I've installed package for centos 7, so it not work well. How I can remove all php package for centos 7 and install 6 instead?

I tried use this commanded below:

Code: Select all

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7.rpm epel-release-latest-7.noarch.rpm
But I think the correct for centos 6 must be:

Code: Select all

wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
When I tried install commanded for centos 6, I got this result:

Code: Select all

[root@server ~]# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
--2020-01-15 21:18:23--  https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
Resolving dl.fedoraproject.org... 209.132.181.24, 209.132.181.25, 209.132.181.23
Connecting to dl.fedoraproject.org|209.132.181.24|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-rpm]
Saving to: “epel-release-latest-6.noarch.rpm.3”

100%[==========================================================>] 14,540      --.-K/s   in 0.01s

2020-01-15 21:18:23 (1.30 MB/s) - “epel-release-latest-6.noarch.rpm.3” saved [14540/14540]

[root@server ~]# wget http://rpms.remirepo.net/enterprise/remi-release-6.rpm
--2020-01-15 21:18:23--  http://rpms.remirepo.net/enterprise/remi-release-6.rpm
Resolving rpms.remirepo.net... 195.154.241.117, 2001:bc8:33a1:100::1
Connecting to rpms.remirepo.net|195.154.241.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15704 (15K) [application/x-rpm]
Saving to: “remi-release-6.rpm.3”

100%[==========================================================>] 15,704      96.2K/s   in 0.2s

2020-01-15 21:18:24 (96.2 KB/s) - “remi-release-6.rpm.3” saved [15704/15704]

[root@server ~]# rpm -Uvh remi-release-6.rpm epel-release-latest-6.noarch.rpm
Preparing...                ########################################### [100%]
        package epel-release-7-9.noarch (which is newer than epel-release-6-8.noarch) is already installed
        package remi-release-7.7-1.el7.remi.noarch (which is newer than remi-release-6.10-1.el6.remi.noarch) is already installed
[root@server ~]#

Re: Remove PHP by accident

Posted: Wed Jan 22, 2020 8:24 pm
by skamasle
Is not posible install php from remi repos for centos 7 in centos 6

So maybe you have duplicate repos and you install all from centos 6

The issue maybe is that you install php70 and not PHP this generate a aditional php version for you and apache cant find correct version

Firt php version always need be php and not PHP-##

So you may need remove all php start from 0

yum remove php* and then yum search php and see there are some php versions some with php and some php##

Re: Remove PHP by accident

Posted: Thu Jan 23, 2020 2:54 pm
by Loc_rabbirt
skamasle wrote:
Wed Jan 22, 2020 8:24 pm
Is not posible install php from remi repos for centos 7 in centos 6

So maybe you have duplicate repos and you install all from centos 6

The issue maybe is that you install php70 and not PHP this generate a aditional php version for you and apache cant find correct version

Firt php version always need be php and not PHP-##

So you may need remove all php start from 0

yum remove php* and then yum search php and see there are some php versions some with php and some php##
I'm follow your step by: yum remove php* then yum search php and I have php from 5.4 up to 7.4. I'm not sure what do to do now, could you help me with all steps to install php and phpmyadmin so I can get my site up again? Thanks you so much for your help.

Re: Remove PHP by accident

Posted: Tue Jan 28, 2020 7:31 pm
by skamasle
Loc_rabbirt wrote:
Thu Jan 23, 2020 2:54 pm
skamasle wrote:
Wed Jan 22, 2020 8:24 pm
Is not posible install php from remi repos for centos 7 in centos 6

So maybe you have duplicate repos and you install all from centos 6

The issue maybe is that you install php70 and not PHP this generate a aditional php version for you and apache cant find correct version

Firt php version always need be php and not PHP-##

So you may need remove all php start from 0

yum remove php* and then yum search php and see there are some php versions some with php and some php##
I'm follow your step by: yum remove php* then yum search php and I have php from 5.4 up to 7.4. I'm not sure what do to do now, could you help me with all steps to install php and phpmyadmin so I can get my site up again? Thanks you so much for your help.
Hi

Just install php version you need

Or try install phpmyadmin

Code: Select all

yum install phpmyadmin
This will install phpmyadmin dependencies ( so php-* )

If not, install php

Code: Select all

yum install php  php-bcmath php-cli php-common php-fpm php-gd php-imap php-mbstring  php-mcrypt phpMyAdmin php-mysql php-pdo  php-pgsql php-soap   php-tidy php-xml php-xmlrpc

Re: Remove PHP by accident

Posted: Tue Feb 04, 2020 6:58 am
by Loc_rabbirt
skamasle wrote:
Tue Jan 28, 2020 7:31 pm
Loc_rabbirt wrote:
Thu Jan 23, 2020 2:54 pm
skamasle wrote:
Wed Jan 22, 2020 8:24 pm
Is not posible install php from remi repos for centos 7 in centos 6

So maybe you have duplicate repos and you install all from centos 6

The issue maybe is that you install php70 and not PHP this generate a aditional php version for you and apache cant find correct version

Firt php version always need be php and not PHP-##

So you may need remove all php start from 0

yum remove php* and then yum search php and see there are some php versions some with php and some php##
I'm follow your step by: yum remove php* then yum search php and I have php from 5.4 up to 7.4. I'm not sure what do to do now, could you help me with all steps to install php and phpmyadmin so I can get my site up again? Thanks you so much for your help.
Hi

Just install php version you need

Or try install phpmyadmin

Code: Select all

yum install phpmyadmin
This will install phpmyadmin dependencies ( so php-* )

If not, install php

Code: Select all

yum install php  php-bcmath php-cli php-common php-fpm php-gd php-imap php-mbstring  php-mcrypt phpMyAdmin php-mysql php-pdo  php-pgsql php-soap   php-tidy php-xml php-xmlrpc
Hi,

Thank you so much for your advice :), I've removed all repo for centos 7 then install repo for centos 6 and it's work well for me again now.