首页 > 运营 > 帮助中心 > 正文

centos 7系统下安装laravel运行环境的步骤详解

2020-07-28 13:58:18
字体:
来源:转载
供稿:网友

前言

因为最近在学习linux,而最好的学习就是实践,学习linux同时安装LAMP的环境搭配,跑了度娘都没找到我想要的文章。那我就简单的写写我在centos7下安装laravel的安装过程。

网络设置

ping 114.114.114.144 网络连接失败,将虚拟机的网络适配器改成桥接模式(自动),然后设置开启启动

打开 /etc/sysconfig/network-scripts/ifcfg-eno16777736,ifcfg-eno16777736是自己对应的配置文件

将里面的ONBOOT改为yes,重启网络服务`systemctl restart network`, 再ping就ok了

升级

//升级所有包同时也升级软件和系统内核yum -y update

SELinux 宽容模式保证安装过程不受影响,其次在项目中,也要关闭

setenforce 0

安装Apache

 //安装 yum -y install httpd //同时安装vim yum install vim  //修改Apache配置文件指向路径 /etc/httpd/conf/httpd.conf  //启动Apache systemctl start httpd   //停止Apache systemctl stop httpd  //重启Apache systemctl restart httpd  //查看Apache状态  systemctl status httpd  // 配置Apache开机启动项 /*chkconfig --add httpd (在服务清单中添加httpd服务)*/ chkconfig httpd on

安装MySql

//如果必须要安装MySQL,首先必须添加mysql社区repo通过输入命sudo rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm//最后使用像安装MySQL的常规方法一样安装//安装mysql命令yum -y installmysql mysql-devel mysql-server mysql-libs//创建root用户密码mysqladmin -u root password 密码 //如果要用外部软件连接数据库关闭防火墙systemctl stop firewalld //查看防火墙状态firewall-cmd --state //禁止firewall开机启动systemctl disable firewalld //设置远程连接GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;//重启mysqlsystemctl restart mysqldcd ..// 

安装PHP5.6

//系统默认安装的是php5.4,对于使用laravel就不行的,以下是CentOS 7.0的epel及remi源。 yum -y install epel-release rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm//使用yum list命令查看可安装的包(Packege)。  yum list --enablerepo=remi --enablerepo=remi-php56 | grep php//安装php5.6及部分扩展 yum -y install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-devel php-mbstring php-mcrypt php-mysqlnd php-phpunit-PHPUnit php-pecl-xdebug php-pecl-xhprof //查看版本 php-v

安装redis

//检查安装依赖程序yum install gcc-c++yum install -y tcl//获取安装文件wget http://download.redis.io/releases/redis-3.2.9.tar.gztar xzf redis-3.2.9.tar.gzmv redis-3.2.9 /usr/local/redis//进入目录cd /usr/local/redis//编译安装make && make install(可能需要 make test 根据提示)//设置配置文件目录mkdir -p /etc/rediscp redis.conf /etc/redis//修改配置文件vim /etc/redis/redis.confdaemonize yes (no -> yes)//启动/usr/local/bin/redis-server /etc/redis/redis.conf//查看启动ps -ef | grep redis//使用客户端测试 redis-cli set name darry Ok get name 'darry'//关闭客户端redis-cli shutdown
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表