CentOS6.5配置PHP CI程序

步骤:
1.安装CentOS6.5系统:
    1.选择PHP+Mysql环境

2.关闭防火墙和SeLinux
    1.chkconfig --level 35 iptables off
    2.vi /etc/selinux/config
        SELINUX=disabled
    3.重启

 

3.设置静态IP[可在全部配置完成后设置]:
    1.vi /etc/sysconfig/network-scripts/ifcfg-eth0
    DEVICE=eth0                 //指出设备名称
    BOOTPROT=static             //启动类型 dhcp|static
    BROADCAST=192.168.1.203     //广播地址
    HWADDR=00:06:5B:FE:DF:7C    //硬件Mac地址
    IPADDR=192.168.0.2          //IP地址
    NETMASK=255.255.255.0       //子网掩码
    NETWORK=192.168.0.0         //网络地址
    GATEWAY=192.168.0.1         //网关地址
    ONBOOT=yes                  //是否启动应用
    TYPE=Ethernet               //网络类型
     2.service network restart
   
3.检查PHP,apache,mysql状态:
    1.php -v
    2.service httpd status
    3.service mysqld status


4.启动服务:
    1.service httpd start
    2.service mysqld start


5.添加开机启动
    1.chkconfig httpd on
    2.chkconfig mysqld on
    3.reboot


6.测试单文件PHP:
    1.cd var/www/html
    2.vi test.php
    3.<?php phpinfo()?>
    4.访问测试


7.上传最新CI框架
    1.使用xftp将文件上传至    /var/www/html


8.进行数据库配置
    1.允许数据库远程连接:
        grant all PRIVILEGES on *.* to ted@'192.168.1.109' identified by '123456';
        flush privileges;
    2.使用Navicat for MySQL连接数据库,建库,执行初始化脚本
    3.开启mysqli扩展:
        1.挂载光驱:
            mkdir /mnt/cdrom           
            mount /dev/cdrom /mnt/cdrom
        2.安装扩展:
            cd /mnt/cdrom/Packages
            rpm -ivh php-mysql-5.3.3-26.el6.x86_64.rpm
            rpm -ivh php-pdo-5.3.3-26.el6.x86_64.rpm
        3.重启服务:
            service httpd restart
            service mysqld restart
        4.赋权:
            grant all PRIVILEGES on *.* to ted@'127.0.0.1' identified by '123456';
            flush privileges;

      
9.修改CI数据库配置:
        1.database.config


10.开启rewrite功能
    1.cd /etc/httpd/conf
    vi httpd.conf
    LoadModule rewrite_module modules/mod_rewrite.so
    2.重启服务
      service httpd restart

 

使用软件:Xmanager Enterprise 5,Navicat for MySQL

 

—记于2015-6-11 15:31:31

posted @ 2015-06-11 15:35  赵碧金  阅读(250)  评论(0编辑  收藏  举报