My project is on Laravel 5.2. and as per guide it required php >= 5.5.6 but there was php 5.4 intalled and I had to upgrade php version through YUM,
But now it is giving error "PDO driver not found" and I tried YUM install php-pdo
but it's giving error that "there is conflict between php56w-common and php-comon-5.4.16". I am stuck on this point
Asked
Active
Viewed 2.3e+01k times
22

Muaaz Khalid
- 2,199
- 2
- 28
- 51

sunny kashyap
- 2,193
- 2
- 19
- 29
-
try to completely remove php5.4 and reinstall php5.6 - or use software collections – Gntem Apr 21 '17 at 08:29
-
@Mr.Phoenix can you please tell me exact command for that – sunny kashyap Apr 21 '17 at 08:41
2 Answers
53
yum -y remove php*
to remove all php packages then you can install the 5.6 ones.
-
11first all of need to get all php first `yum list installed | grep php` and depend on php version you installed, for my case I run `yum remove -y php71*` – Mike Nguyen Dec 10 '18 at 07:51
27
Subscribing to the IUS Community Project Repository
cd ~
curl 'https://setup.ius.io/' -o setup-ius.sh
Run the script:
sudo bash setup-ius.sh
Upgrading mod_php with Apache
This section describes the upgrade process for a system using Apache as the web server and mod_php to execute PHP code. If, instead, you are running Nginx and PHP-FPM, skip ahead to the next section.
Begin by removing existing PHP packages. Press y and hit Enter to continue when prompted.
sudo yum remove php-cli mod_php php-common
Install the new PHP 7 packages from IUS. Again, press y and Enter when prompted.
sudo yum install mod_php70u php70u-cli php70u-mysqlnd
Finally, restart Apache to load the new version of mod_php:
sudo apachectl restart
You can check on the status of Apache, which is managed by the httpd systemd unit, using systemctl:
systemctl status httpd

Rory McCrossan
- 331,213
- 40
- 305
- 339

Ahmed Ginani
- 6,522
- 2
- 15
- 33
-
1https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-php-7-on-centos-7 – Ghasem Nov 06 '18 at 06:10