zoukankan      html  css  js  c++  java
  • lnmp

    1、         操作系统

    CentOS release 6.5(final)

    2、         安装mysql

    # yum install mysql-server

    #vi  /etc/my.cnf     +default-character-set=utf8

     #chkconfig --add mysqld   chkconfig --level 35 mysqld on//开机启动  查看#chkconfig --list | grep mysql*

    #service mysqld stop //停止restart//重启 start//启动

    #mysqladmin -u root password 123456  //设置管理员密码

    #UPDATE user SET `Host` = '%' WHERE `User` = 'root' LIMIT 1;FLUSH PRIVILEGES;//所有主机root连接

    #vi /etc/sysconfig/iptables

    增加:-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

    #service iptables restart

    3、         安装nginx

    先安装nginx的yum源

    http://nginx.org/en/linux_packages.html#stable 找到链接,安装:

    #rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

    查看:

    #yum info nginx

    安装:

    #yum install nginx

    #service nginx start

    默认配置:/etc/nginx/conf.d/

    4、         安装php

    #wget http://cn2.php.net/get/php-5.6.23.tar.gz/from/this/mirror

    #tar –zxvf php-5.6.23.tar.gz

    #yum install epel-release

    或者

    #rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

    #yum install gcc bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libxml2-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel libpng-devel

    #cd php-5.6.23

    #./configure

    --prefix=/usr/local/php56

    --with-config-file-path=/usr/local/php56/etc

    --enable-inline-optimization

    --disable-debug

    --disable-rpath

    --enable-shared

    --enable-opcache

    --enable-fpm

    --with-fpm-user=nginx

    --with-fpm-group=nginx

    --with-mysql=mysqlnd

    --with-mysqli=mysqlnd

    --with-pdo-mysql=mysqlnd

    --with-gettext

    --enable-mbstring

    --with-iconv

    --with-mcrypt

    --with-mhash

    --with-openssl

    --enable-bcmath

    --enable-soap

    --with-libxml-dir

    --enable-pcntl

    --enable-shmop

    --enable-sysvmsg

    --enable-sysvsem

    --enable-sysvshm

    --enable-sockets

    --with-curl

    --with-zlib

    --enable-zip

    --with-bz2

    --with-gd

    --with-freetype

    --with-readline

         #make -j8
        #make install
     
        配置 PHP
     
    配置文件:
     
    # cp php.ini-development /usr/local/php56/etc/php.ini
    php-fpm 服务
     
    # cp /usr/local/php56/etc/php-fpm.conf.default /usr/local/php56/etc/php-fpm.conf
    # cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm56
    # chmod +x /etc/init.d/php-fpm56
    启动 php-fpm
     
    # service php-fpm56 start
    Starting php-fpm  done
    php-fpm 可用参数 start|stop|force-quit|restart|reload|status
     
    添加 PHP 命令到环境变量
     
    编辑 ~/.bash_profile,将:
     
    PATH=$PATH:$HOME/bin
    改为:
    PATH=$PATH:$HOME/bin:/usr/local/php56/bin
    使 PHP 环境变量生效:
     
    # . ~/.bash_profile
    查看看 PHP 版本
     
    # php -v
     
  • 相关阅读:
    获得微软最具影响力开发者(GDI)
    推荐一个制作卡通头像的网站(超强)
    李煜词全集
    15款语言学习2.0网络服务
    SNS社么时候回归社交? !!
    公司附近雪景
    Powershell实践之Discuz!NT自动打包发布
    使用 Office Live 时 Install Office Live Update 1.2出错的解决办法
    修改linux swap空间的swappiness,降低对硬盘的缓存
    TFS "TF30063: 您没有权限访问 MicrosoftIIS/7.0."
  • 原文地址:https://www.cnblogs.com/nowphp/p/5638230.html
Copyright © 2011-2022 走看看