美文网首页
linux环境启php项目

linux环境启php项目

作者: _Irving | 来源:发表于2023-02-20 11:08 被阅读0次

    上文已经讲过mysql的安装

    apache安装

    #安装
    [root@localhost ~]# yum install -y httpd
    #修改配置文件
    [root@localhost ~]# vim  /etc/httpd/conf/httpd.conf
    #
    # ServerName gives the name and port that the server uses to identify itself.
    # This can often be determined automatically, but we recommend you specify
    # it explicitly to prevent problems during startup.
    #
    # If your host doesn't have a registered DNS name, enter its IP address here.
    ServerName 192.168.213.132:80     #修改此处
    #启动
    [root@localhost ~]# systemctl start httpd.service
    查看错误日志
    [root@localhost ~]# tail -f /var/log/httpd/error_log
    

    安装php

    安装php
    [root@localhost ~]# yum install -y php
    //安装组件,支持mysql
    [root@localhost ~]#yum install php-mysql php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt
    

    项目启动

    • 将项目文件复制到如下路径下:
    [root@localhost html]# pwd
    /var/www/html
    [root@localhost html]# ll
    total 12
    drwxrwxr-x. 13 wanchao wanchao 8192 Feb 19 22:26 bWAPP
    
    • 其他将项目需要的数据库信息执行到mysql数据库里,然后在相应文件配置好数据库配置
    // Database connection settings
    $db_server = "localhost";
    $db_username = "root";
    $db_password = "123456";
    $db_name = "bwapp";
    
    • 然后重启httpd,在浏览器访问即可
    [root@localhost html]# systemctl restart httpd.service
    
    登录页面

    相关文章

      网友评论

          本文标题:linux环境启php项目

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