How to uninstall PHP 5.4.16

22,382

It appears that you want to install a newer version of PHP-MySQL module. You need to be aware that mysql_ library was deprecated years ago and it has been removed entirely in PHP 7. Use a modern replacement such as PDO or mysqli_ instead. See this answer

If you are using CentOS 7, I recommend that you use IUS repository rather than webtatic. So you can disable or remove webtatic repo. I also recommend you remove packages installed from it. For example:

yum -y remove php70w*

Now install php7 after disabling or removing webtatic repo.

For php7.1*

yum -y install php71* 

For php7.2*

yum -y install php72*

Try to see if MySQL is supported:

yum list installed | grep -i mysql

If you see php71u-mysqlnd.* for example, it is already supported.

Share:
22,382

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin over 1 year

    My VPS came with PHP 5.4.16-43.el7_4.1 installed and I am trying to install PHP 7+, but I have been unable to do so.

    Then when I try to install a library, it conflicts, as shown here:

    # yum -y install php-mysql
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: repos-va.psychz.net
     * epel: mirror.us-midwest-1.nexcess.net
     * extras: mirrors.greenmountainaccess.net
     * ius: archive.linux.duke.edu
     * updates: mirror.vcu.edu
     * webtatic: us-east.repo.webtatic.com
    Resolving Dependencies
    --> Running transaction check
    ---> Package php-mysql.x86_64 0:5.4.16-43.el7_4.1 will be installed
    --> Processing Dependency: php-pdo(x86-64) = 5.4.16-43.el7_4.1 for package: php-mysql-5.4.16-43.el7_4.1.x86_64
    --> Running transaction check
    ---> Package php-pdo.x86_64 0:5.4.16-43.el7_4.1 will be installed
    --> Processing Dependency: php-common(x86-64) = 5.4.16-43.el7_4.1 for package: php-pdo-5.4.16-43.el7_4.1.x86_64
    --> Running transaction check
    ---> Package php-common.x86_64 0:5.4.16-43.el7_4.1 will be installed
    --> Processing Conflict: php70w-common-7.0.27-1.w7.x86_64 conflicts php-common < 7.0
    --> Finished Dependency Resolution
    Error: php70w-common conflicts with php-common-5.4.16-43.el7_4.1.x86_64
     You could try using --skip-broken to work around the problem
     You could try running: rpm -Va --nofiles --nodigest
    

    How can I completely remove this old version of PHP?

    • Admin
      Admin about 6 years
      Get rid of the conflicting webtatic packages, and never go anywhere near their stuff.