Upgrading PHP to 5.6.x or later on CentOS7 via Yum and the IUS repo

CentOS7 (and some of the other RHEL flavours) currently don’t include PHP 5.6+ in the core repos, and yet the versions of PHP bundled are at EOL or close to it.

A number of guides suggest using the webstatic or remi repos – but this is not recommended as they contain packages with names that conflict with packages in core repos.

One of the better options is to use the IUS repo (Inline with Upstream Stable project), which means you can quickly and easily update.

First, install the IUS rep (you will need the EPEL repo if you haven’t got it already)

yum install https://centos7.iuscommunity.org/ius-release.rpm

Next, we install, then use yum-plugin-replace to replace the existing PHP package

yum install yum-plugin-replace
yum replace --replace-with php56u php

Finally httpd should be restarted, and you should be good to go

service httpd restart

DigitalOcean has a more detailed post on installing PHP7 from the same repo.

Setting up a CentOS 7 local development VM with LAMP (Linux, Apache, MariaDB/MySQL, PHP+PHPMyAdmin)

I’m going to build a local VM with the following requirements:
1) It can host PHP/SQL-based websites
2) It has PHPMyAdmin to help administer any SQL databases
3) It matches available builds from popular providers (i.e. you can provision it in a similar way on Azure or AWS, but with a public domain name)
4) It only has a single account (this is not recommended for public systems)
5) I can access the web root using SFTP

As I already have several CentOS builds that have always been pre-setup with CPanel (and because CentOS is free), I’ve decided to do this build from scratch and without a control panel. I’m not going to be configuring options like multiple user accounts, so things will be fairly simple.

I’ll do it in steps (and test each time) to make sure everything’s working correctly. You could install everything all at once, but that would make it much harder to troubleshoot if an element didn’t work.

Continue reading “Setting up a CentOS 7 local development VM with LAMP (Linux, Apache, MariaDB/MySQL, PHP+PHPMyAdmin)”

CentOS 7 Linux Minimal Install – ifconfig: command not found (let’s use ip instead)

As someone who doesn’t closely follow what’s happening with Linux tools, I recently tried a minimal CentOS 7 install, and found out by chance that a command I use a lot on Windows has been deprecated in a number of Linux releases.

Not having run into this before, my first thought was to see if it was in the core repos.

yum provides ifconfig

ifconfig is part of the net-tools package

Continue reading “CentOS 7 Linux Minimal Install – ifconfig: command not found (let’s use ip instead)”