Mysql + PHP

    1.Mysql安裝php

      *  yum install gcc-c++  ncurses-devel -y  ##解決依賴性html

      *  tar zxf mysql-boost-5.7.17.tar.gz  ##解壓文件
mysql

      *  tar zxf mysql-boost-5.7.17.tar.gz   ##安裝CMAKE工具
nginx

      *  useradd -M -d /usr/local/lnmp/nginx -s /sbin/nologin -u 800 nginx  ##添加用戶
c++

      *  cmake -DCMAKE_INSTALL_PREFIX=/usr/local/lnmp/mysql   -DMYSQL_DATADIR=/usr/local/lnmp/mysql/data    -DMYSQL_UNIX_ADDR=/usr/local/lnmp/mysql/data/mysql.sock -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all 
         ## 在解壓目錄下安裝sql

wKioL1lz-6qipdgbAAFJ37Ur7Mo236.png

      *  rm -fr CMakeCache.txt   ##清理緩存
vim

      *  make && make install    ##編譯和安裝
api

      *  groupadd -g 27 mysq
緩存

      *  useradd -u 27 -g 27 -s /sbin/nologin -M -d /usr/local/lnmp/mysql/ mysq  ##添加用戶
bash

      *  vim /etc/passwd   ##修改用戶路徑

wKiom1lz_P-QLImrAABez0LFQjI611.png

      *  cd /usr/local/lnmp/mysql/support-files/

      *  cp my-default.cnf /etc/my.cnf   ##複製配置文件

wKiom1lz_X2B5xjLAABVQGjjKCU868.png

     *    cd /usr/local/lnmp/mysql/bin/  

           vim ~/.bash_profile   ##修改環境變量

wKioL1lz_k-S50IEAAAevXE8bic095.png

     *    source~/.bash_profile  ##使環境變量生效

     *    chown mysql.mysql . -R   ##修改用戶和用戶組

     *    mysqld --initialize --user=mysql   ##安裝

wKioL1lz_6CAzlITAAIFPt_xj6Q217.png

     *    chown root.root . -R
           chown mysql data -R

wKioL1lz_8OR7NTaAABJapJXTbw397.png

     *   cp mysql.server /etc/init.d/mysqld   ##添加mysqld命令

     *   /etc/init.d/mysqld start    ##開啓Mysql

wKioL1l0AK-xjPC5AAByPYQoXhw748.png

     *   mysql_secure_installation    ##Mysql初始化

wKioL1l0AMnQD89RAADUz6azVLU781.png

  

    測試:

wKiom1l0APny1WGFAAECBKGF5zk073.png

  

     2.PHP 安裝 

     *   tar jxf php-5.6.20.tar.bz2   cd php-5.6.20  ##解壓文件,進入文件目錄

     * ./configure  --prefix=/usr/local/lnmp/php   --with-config-file-path=/usr/local/lnmp/php/etc   --with-mysql=mysqlnd  --with-mysqli=mysqlnd   --with-pdo-mysql=mysqlnd  --with-openssl --with-snmp  --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir  --with-jpeg-dir  --with-freetype-dir --with-gmp --with-gettext --enable-inline-optimization  --enable-soap  --enable-ftp --enable-sockets --enable-mbstring  --enable-fpm  --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt --with-mhash

     ## 在解壓目錄下安裝

wKiom1l0AdGBMeArAAGIRODnXPc582.png

     *  yum install libxml2-devel -y    ##解決依賴性
         yum install curl-devel -y
         yum install libjpeg-devel -y
         yum install libpng-devel -y
         yum install freetype-devel -y
         yum install gmp-devel -y
         rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm  
         rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpm   
         yum install net-snmp-devel -y
         yum install -y bison
         rpm -ivh re2c-0.13.5-1.el6.x86_64.rpm

     *  make   ##編譯和安裝
         make install

     *   cd   /php-5.6.20

          cp php.ini-prodection  /usr/local/lnmp/php/etc/php.ini   ##複製配置文件

          cd  /sapi/fpm

          cp init.d.php-fpm        /etc/init.d/php-fpm     ##添加PHP命令

          chmod +x    /etc/init.d/php-fpm

     *    vim /usr/local/lnmp/php/etc/php.ini   ##修改配置文件

wKiom1l0BJ7iVuPtAABuBC5_7F4547.png

     *   cd /usr/local/lnmp/php/etc

          cp php-fpm.conf.default   php-fpm.conf

wKioL1l0BZSyUO2rAABLv9Syv2s562.png

     *   vim php-fpm.conf

wKioL1l0Bb_TH3jfAAATkObcsHQ761.png

     *

     *

     *   /etc/init.d/php-fpm  start  ##開啓服務

     *    vim ~/.bash_profile 

wKioL1l0BnuB1CU4AAA6XDGGF7k751.png

     *    source~/.bash_profile

     *    vim /usr/local/lnmp/ngix/conf/nginx.conf

wKioL1l0B0HQR9RMAAAkt237MzA842.png

wKiom1l0B0Lgkv5MAAA6XDGGF7k093.png

     *  nginx -s reload   

  測試


    3.論壇安裝 Discuz
    * unzip Discuz_X3.2_SC_UTF8.zip  
    * mv upload/ /usr/local/lnmp/nginx/html/bbs 

wKiom1l0CPWT2waFAADwI_CxmCo872.png  

    * cd /usr/local/lnmp/nginx/html/bbs/
    * chmod 777 config/ data/ uc_client/ uc_server/ -R

wKioL1l0CSPBIrZxAADbDEgjKsA108.png

    * vim  /usr/local/lnmp/php/etc/php.int

wKioL1l0Cc3DN69eAABEiMNEDwk691.png

wKiom1l0Ca7yePA9AABQLX6llU8066.png

 wKioL1l0ClqiZqeaAAAsksrpN6A206.png

    * /etc/init.d/php-fpm reload
    * cd /usr/local/lnmp/mysql/
    * chmod 755 /usr/local/lnmp/mysql/data/

wKioL1l0C5Xi2r0rAAA28fdOaw4894.png

    * cd /usr/local/lnmp/nginx/html/ bbs/install
    * rm -fr index.php

wKioL1l0DReA3GCoAABazpGM03A265.png

相關文章
相關標籤/搜索