centos8 yum安装php7+swoole+mysql+nginx+redis

举报
仙士可 发表于 2023/06/21 17:31:11 2023/06/21
【摘要】 #install libs yum -y update yum install -y curl zip unzip wget openssl-devel gcc-c++ make autoconf git passwd#install php rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarc...
#install libs
 yum -y update
 yum install -y curl zip unzip  wget openssl-devel gcc-c++ make autoconf git passwd
#install php
 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
 rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-8.rpm
 yum install -y php74 php74-php php74-php-devel php74-php-bcmath php74-php-cli php74-php-common php74-php-gd php74-php-json php74-php-mbstring php74-php-xml
 rm -rf /usr/bin/php && ln -s /opt/remi/php74/root/usr/bin/php /usr/bin/php\
    && rm -rf /usr/bin/phpize &&  ln -s /opt/remi/php74/root/usr/bin/phpize /usr/bin/phpize\
    && rm -rf /usr/bin/php-config &&  ln -s /opt/remi/php74/root/usr/bin/php-config /usr/bin/php-config

# composer
 curl -sS https://getcomposer.org/installer | php \
    && mv composer.phar /usr/bin/composer && chmod +x /usr/bin/composer
# use aliyun composer
 composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

#安装ssh服务
 yum install -y openssh-server
 mkdir -p /var//sshd
 mkdir -p /root/.ssh
#取消pam限制
 sed -ri \
"s/session required pam_loginuid.so/#session required pam_loginuid.so/g" /etc/pam.d/sshd

 wget https://github.com/swoole/swoole-src/archive/v4.4.23.tar.gz -O swoole.tar.gz \
    && mkdir -p swoole \
    && tar -xf swoole.tar.gz -C swoole --strip-components=1 \
    && rm -rf swoole.tar.gz \
    && ( \
    cd swoole \
    && phpize \
    && ./configure --enable-openssl \
    && make \
    && make install \
    ) \
    && sed -i "2i extension=swoole.so" `php -i | grep php.ini |  awk -F "=>" '{print $2}' |grep php.ini` \
    && rm -rf swoole

wget https://repo.mysql.com//mysql80-community-release-el8-1.noarch.rpm
yum install mysql mysql-server -y
systemctl start mysqld
yum install nginx -y
systemctl start nginx
yum install redis -y
systemctl start redis
#ALTER USER USER() IDENTIFIED BY '123456';
#use mysql;
#update user set host='%' where user = 'root';
#flush privileges;
复制
 
【版权声明】本文为华为云社区用户原创内容,转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息, 否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。