Tag: centos7

  • Install PHP 7.4 on CentOS 7

    To install PHP 7.4 on CentOS 7, first install remi repository.

    yum install epel-release -y
    rpm -ivh https://rpms.remirepo.net/enterprise/remi-release-7.rpm
    

    Set PHP 7.4 as default PHP

    yum install yum-utils
    yum-config-manager --enable remi-php74
    

    Install PHP with

    yum install -y php php-bcmath php-cli php-common php-devel php-gd \
        php-imap php-intl php-json php-ldap php-lz4 php-mbstring php-mysqlnd \
        php-soap php-intl php-opcache php-xml php-pdo
    

    After installing check PHP version with php -v, you will see

    CentOS 7 iinstall PHP 7.4

    At the time of installation, it is PHP version 7.4.0RC3, it will change as new 7.4 release become available.

    Related Posts

    Install PHP 7.2 on Ubuntu
    Install PHP 7.3 in CentOS 8
    PHP

  • Install MySQL 8 on CentOS, RHEL 6/7

    Install MySQL 8 on CentOS, RHEL 6/7

    To Add MySQL yum repository to your server, go to

    https://dev.mysql.com/downloads/repo/yum/

    Download the rpm file available.

    For RHEL/CentOS 7

    wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
    rpm -ivh mysql80-community-release-el7-3.noarch.rpm
    

    For RHEL/CentOS 6

    wget https://dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm
    rpm -ivh mysql80-community-release-el6-1.noarch.rpm
    

    Installing MySQL Server

    yum install mysql-community-server
    

    Stop/Start MySQL

    To stop/start MySQL, use service name “mysqld”.

    systemctl start mysqld
    systemctl stop mysqld
    systemctl restart mysqld
    

    MySQL 8 root Password

    When MySQL first starts, it create a random password and store in MySQL log file. To find the MySQL root password, run

    grep 'temporary password' /var/log/mysqld.log
    

    This default password don’t allow you to do anything, so login to MySQL with this password and set a secure password for root.

    ALTER USER 'root'@'localhost' IDENTIFIED  BY 'MYSQL_ROOT_PASSOWRD';
    

    MYSQL_ROOT_PASSOWRD – replace it with you secure new MySQL root password.

    Installing Older Version of MySQL

    When you add MySQL repository, it activate latest version by default. If you want older version, say 5.7, you need to activate it.

    To see available repository, run

    yum repolist all | grep mysql
    

    To disable MySQL 8 repository, run

    yum-config-manager --disable mysql80-community
    

    To enable MySQL 5.7 repository, run

    yum-config-manager --enable mysql57-community
    

    Now installing MySQL server will install MySQL 5.7 instead of latest version.

    MySQL CentOS