0

I would like to update PHP 7.0.2.6 to the latest 7.2 version on my CentOS 7 server (with DirectAdmin installed) via SSH. I found many procedures on the internet, but none of them seems to work. I was told the procedure should look like this:

  1. yum install epel-release
  2. rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
  3. yum list installed php*
  4. yum remove php*
  5. yum install --enablerepo=remi-php72 php php-mcrypt php-cli php-gd php-curl
  6. php-mysql php-ldap php-zip php-fileinfo
  7. php -v

I get stuck with step 4, giving the result below. Any thoughts what could be the issue here?

[root@vps ~]# yum list installed php*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: ams.edge.kernel.org
 * epel: ams.edge.kernel.org
 * extras: mirror.nforce.com
 * ius: mirror.ehv.weppel.nl
 * remi-php71: remi.mirror.wearetriple.com
 * remi-php72: remi.mirror.wearetriple.com
 * remi-safe: remi.mirror.wearetriple.com
 * updates: centos.mirror.transip.nl
 * webtatic: uk.repo.webtatic.com
Error: No matching Packages to list

Additional information:

[root@vps ~]# dir -A .bash_history .custombuild .rnd .bash_logout epel-release-latest-7.noarch.rpm setup-ius.sh .bash_profile .pki .spamassassin .bashrc remi-release-7.rpm .ssh .cshrc remi-release-7.rpm.1 .tcshrc

Result step 5:

[root@vps ~]# yum install --enablerepo=remi-php72 php php-mcrypt php-cli php-gd php-curl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                     |  30 kB     00:00
 * base: ams.edge.kernel.org
 * epel: ams.edge.kernel.org
 * extras: mirror.nforce.com
 * ius: mirror.amsiohosting.net
 * remi-php71: remi.mirror.wearetriple.com
 * remi-php72: remi.mirror.wearetriple.com
 * remi-safe: remi.mirror.wearetriple.com
 * updates: centos.mirror.transip.nl
 * webtatic: uk.repo.webtatic.com
base                                                     | 3.6 kB     00:00
extras                                                   | 3.4 kB     00:00
ius                                                      | 2.3 kB     00:00
remi-php71                                               | 3.0 kB     00:00
remi-php72                                               | 3.0 kB     00:00
remi-safe                                                | 3.0 kB     00:00
updates                                                  | 3.4 kB     00:00
webtatic                                                 | 3.6 kB     00:00
(1/3): remi-php72/primary_db                               | 209 kB   00:00
(2/3): remi-php71/primary_db                               | 230 kB   00:00
(3/3): remi-safe/primary_db                                | 1.4 MB   00:00
No package php available.
No package php-mcrypt available.
No package php-cli available.
No package php-gd available.
No package php-curl available.
Error: Nothing to do
6
  • Is there a file matching the pattern "php*" in root's home directory? Try quoting the "php*".
    – Jeff Schaller
    Commented Nov 14, 2018 at 13:18
  • I don't think so (added additional information to the post) and quoting PHP gives the same result.
    – Sjors
    Commented Nov 14, 2018 at 14:59
  • Is PHP running on this machine? If so, it looks like you do not have PHP installed via the CentOS system packages so any upgrade path through YUM will probably not work. You will need to determine how PHP is running on your machine and how it got installed, then check if there are any update procedures for your current install. Do you run a control panel (such as cPanel) that would be handling PHP for you? Commented Nov 14, 2018 at 20:38
  • If you really don't have php installed, then you seem (to me) to have accomplished the goal of step #4; you could try proceeding with step #5, after confirming GracefulRestart's suspicious about whether & how php is installed on the system.
    – Jeff Schaller
    Commented Nov 14, 2018 at 20:59
  • I have added the result of step 5 in the initial post, claming that there are no packages available. I use DirectAdmin version 1.54.1 on CentOS 7.0 64-Bit.
    – Sjors
    Commented Nov 14, 2018 at 22:02

2 Answers 2

0

On DirectAdmin's site, it specifically states not to install or upgrade PHP (or Apache) via the package manager.

Instead, you will need to do it via the CustomBuild script.

There are instructions at this link and I'll give an overview in case the link changes or becomes unavailable:

https://www.transip.eu/knowledgebase/entry/420-directadmin-want-update-the-version/

cd to where the custombuild directory is located which will contain the build script.

Run ./build version to make sure that it is version 2.0. If it is, then skip this next part. If it's not, then

mv custombuild custombuild_1.x
wget -O custombuild.tar.gz http://files.directadmin.com/services/custombuil/2.0/custombuild.tar.gz
tar xvzf custombuild.tar.gz
cd custombuild

Update PHP

./build set php1_release 7.2
./build update
./build php d

Check the software versions to make sure that PHP has been updated:

./build versions

httpd will normally restart but if it doesn't, you can do it manually.

1
  • @Sjors You are welcome. Commented Nov 15, 2018 at 11:57
0

Try - yum list installed | grep php

2
  • 'yum list installed | grep php' doesn't give a result back..
    – Sjors
    Commented Nov 14, 2018 at 18:57
  • Then there was no php installed by yum. If there is php on your system it must have been built from source.
    – user103944
    Commented Nov 16, 2018 at 13:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .