美文网首页
CentOS下的PHP 环境配置 VMware + CentOS

CentOS下的PHP 环境配置 VMware + CentOS

作者: LuckTime | 来源:发表于2016-08-19 10:38 被阅读50次

    1.下载VMWare  点击地址链接:http://pan.baidu.com/s/1nvrns5j 密码:uyzz(版本包含 9 或11或者12)

    在CentOS 7.2 环境下安装

    2.CentOS 系统 7.2 地址下载

    3.LAMP环境的快速搭建推荐链接:

    在CentOS 6.5环境下安装

    (1)启动Apache 出现的问题

    1.出现问题:连不上网络 。链接可看下设置CentOS_7的网络
    或者修改vi /etc/sysconfig/network-scripts/ifcfg-(自己的网卡)设置BOOTPROTO=static为静态

    2.网络不通。 测试:ping www.baidu.com 发现网络不通。
    查看是否有网卡,如果没有。则需要打开

    Paste_Image.png
    vi /etc/sysconfig/network-scripts/ifcfg-enoxxxxxx。
    更改这部分
    ONBoot = yes
    Service network restart 重新启动服务 Paste_Image.png

    3.远程web浏览器无法打开页面
    测试centos 是否打开apache curl localhost
    修改防火墙端口号:
    查看当前配置:iptables -L
    防火墙配置文件:
    vi /etc/sysconfig/iptables
    开放80端口:
    iptables -A INPUT -p tcp -s 0/0 --dport 8180 -j ACCEPT
    重启服务:
    /etc/rc.d/init.d/iptables restart
    启动和停止服务分别用start、stop
    chkconfig –level 2345 iptables off
    service iptables stop不推荐关闭防火墙

    1. 重启后生效
    Paste_Image.png

    (2)启动mysql 和配置相关命令
    出现错误:mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)'
    原因 mysql登录错误

    解决办法

    composer update 失败 :之前要 执行composer global require ”fxp/composer-asset-plugin:1.
    或者 php composer.phar global require “fxp/composer-asset-plugin:1.

    然后 composer update

    相关文章

      网友评论

          本文标题:CentOS下的PHP 环境配置 VMware + CentOS

          本文链接:https://www.haomeiwen.com/subject/mkmvsttx.html