How do you Install php-mysql on CentOS

02
2013-08
  • qodeninja

    if i try to install php-mysql I get the following error... not sure how to recover from it to get MySQL and the PHP MySQL module up and running

    [12:51]~> yum install php-mysql
    Loaded plugins: fastestmirror, priorities
    Loading mirror speeds from cached hostfile
     * addons: mirror.rocketinternet.net
     * base: mirror.san.fastserv.com
     * epel: mirrors.kernel.org
     * extras: mirror.nic.uoregon.edu
     * ius: www.applesauceman.com
     * updates: mirror.5ninesolutions.com
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package php-mysql.x86_64 0:5.1.6-27.el5_5.3 set to be updated
    --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-mysql
    --> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: php-mysql
    --> Processing Dependency: libmysqlclient.so.15()(64bit) for package: php-mysql
    --> Running transaction check
    ---> Package mysql.x86_64 0:5.0.77-4.el5_5.4 set to be updated
    ---> Package php-common.x86_64 0:5.1.6-27.el5_5.3 set to be updated
    --> Processing Conflict: mysql conflicts MySQL
    --> Finished Dependency Resolution
    mysql-5.0.77-4.el5_5.4.x86_64 from updates has depsolving problems
      --> mysql conflicts with MySQL-server-community
    Error: mysql conflicts with MySQL-server-community
     You could try using --skip-broken to work around the problem
     You could try running: package-cleanup --problems
                            package-cleanup --dupes
                            rpm -Va --nofiles --nodigest
    The program package-cleanup is found in the yum-utils package.
    
  • Answers
  • Ignacio Vazquez-Abrams

    You'll need to install the shared compatibility libraries package from the same place that you got the server package first.


  • Related Question

    CentOS: installing a PHP module without updating PHP
  • dan

    I am running PHP 5.3.5.

    Now I need to install the php-mbstring module.

    When I run:

    yum install php-mbstring
    

    I am asked to update PHP:

    Installing:
     php-mbstring                              x86_64                              5.3.6-3.el5.remi                                remi                              2.3 M
    Updating for dependencies:
     mysql                                     x86_64                              5.5.11-1.el5.remi                               remi                              7.4 M
     mysql-libs                                x86_64                              5.5.11-1.el5.remi                               remi                              1.1 M
     mysql-server                              x86_64                              5.5.11-1.el5.remi                               remi                               12 M
     php                                       x86_64                              5.3.6-3.el5.remi                                remi                              1.4 M
     php-cli                                   x86_64                              5.3.6-3.el5.remi                                remi                              2.6 M
     php-common                                x86_64                              5.3.6-3.el5.remi                                remi                              973 k
     php-devel                                 x86_64                              5.3.6-3.el5.remi                                remi                              623 k
     php-gd                                    x86_64                              5.3.6-3.el5.remi                                remi                              208 k
     php-mysql                                 x86_64                              5.3.6-3.el5.remi                                remi                              159 k
     php-pdo                                   x86_64                              5.3.6-3.el5.remi                                remi                              117 k
     php-xml                                   x86_64                              5.3.6-3.el5.remi                                remi                              221 k
    
    Transaction Summary
    =======================================================================================================================================================================
    Install      1 Package(s)         
    Update      11 Package(s)         
    Remove       0 Package(s) 
    

    How can I install the module for the PHP version 5.3.5 so that I can avoid updating PHP?

    Thanks,
    Dan


  • Related Answers
  • Patches

    To install a specific version of a package with YUM, you append a dash and the version to the package name. But the versions used by YUM/RPM are slightly different from the official versions, as shown by the version column in the output you provided. So first, run yum info to check what version you have installed:

    yum info installed php
    

    Once you've figured that out, then you can install the right version. For example, if the installed version was 5.3.6-1.el5.remi, you'd run:

    yum install php-mbstring-5.3.5-1.el5.remi
    

    That being said, PHP 5.3.6 fixes 6 security bugs and over 60 other problems. It introduces no major changes and will not break existing applications. You really should upgrade.