您正在查看: 标签 centos 下的文章

centos7 下安装php7&mysql

花了半天时间把另外一个服务器安装php7,并且安装mariadb

在此做下记录

首先按照官网来安装php7 php官网

但是其中configure是错误的,会导致报错

./configure --enable-fpm --with-mysql

改为

./configure --enable-fpm --with-mysqli

到这里基本安装php7就没什么大问题了,期间在./configure的时候可能会提示确实某些包,百度然后yum安装就好了

2.安装mysql

yum install mysql mysql-devel

然后会下载安装相应的mariadb版本

接着安装 yum install mariadb-server (我也不知道为什么mysql没有mysql-server)

安装完mariadb服务器版就多了mysql用户组,然后就进行权限赋值

chmod -R mysql:mysql /var/lib/mysql

接着设置开机启动以及启动
systemctl enable mariadb.service
systemctl start mariadb.service

然后运行 mysql -uroot

最后设置密码

UPDATE mysql.user SET Password=PASSWORD('password') where USER='root';
flush privileges;

花了半天时间把另外一个服务器安装php7,并且安装mariadb

在此做下记录

首先按照官网来安装php7 php官网

但是其中configure是错误的,会导致报错

./configure --enable-fpm --with-mysql

改为

./configure --enable-fpm --with-mysqli

到这里基本安装php7就没什么大问题了,期间在./configure的时候可能会提示确实某些包,百度然后yum安装就好了

2.安装mysql

yum install mysql mysql-devel

然后会下载安装相应的mariadb版本

接着安装 yum install mariadb-server (我也不知道为什么mysql没有mysql-server)

安装完mariadb服务器版就多了mysql用户组,然后就进行权限赋值

chmod -R mysql:mysql /var/lib/mysql

接着设置开机启动以及启动
systemctl enable mariadb.service
systemctl start mariadb.service

然后运行 mysql -uroot

最后设置密码

UPDATE mysql.user SET Password=PASSWORD('password') where USER='root';
flush privileges;

yum 更新 git 到1.8.3版本

yum update git 时发现源比较落后,便开始寻求更新方法(以前就弄过太久没弄又忘了。。。)

得出了以下的解决方法

1、下载repo, -o 也就是 --output-file, 把下面链接下载的放到某位置上

wget -O /etc/yum.repos.d/PUIAS_6_computational.repo https://gitlab.com/gitlab-org/gitlab- recipes/raw/master/install/centos/PUIAS_6_computational.repo

2、这个是下载GPG KEY

wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias

3、验证key是否安装成功

rpm -qa gpg*

4、验证yum是否正常

yum repolist

这步过后可能会出现异常情况,显示 Cannot retrieve repository metadata (repomd.xml) for repository: nginx

假若出现这个,执行 yum clean all 和 yum makecache即可

接着 yum update

yum update git

git --version #1.8.3

yum update git 时发现源比较落后,便开始寻求更新方法(以前就弄过太久没弄又忘了。。。)

得出了以下的解决方法

1、下载repo, -o 也就是 --output-file, 把下面链接下载的放到某位置上

wget -O /etc/yum.repos.d/PUIAS_6_computational.repo https://gitlab.com/gitlab-org/gitlab- recipes/raw/master/install/centos/PUIAS_6_computational.repo

2、这个是下载GPG KEY

wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias && rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias

3、验证key是否安装成功

rpm -qa gpg*

4、验证yum是否正常

yum repolist

这步过后可能会出现异常情况,显示 Cannot retrieve repository metadata (repomd.xml) for repository: nginx

假若出现这个,执行 yum clean all 和 yum makecache即可

接着 yum update

yum update git

git --version #1.8.3