微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

记一次“愉快”的lnmp环境的搭建

 

愉快的lnmp环境搭建

 

  • 后续更新
  • 几个笔记记录
    yum remove PHP-MysqL
    
    yum -y install cmake autoconf wget gcc-c++ gcc zlib pcre pcre-devel 
    yum -y install bison bison-devel perl vim libjpeg libjpeg-devel libpng libpng-devel
    yum -y install freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel
    yum -y install bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel
    yum -y install openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers make gd gd2 gd-devel gd2-devel
    yum -y libaio mlocate lsof epel-release libmcrypt libmcrypt-devel mhash libiconv mcrypt libzip openssl openssl-devel MysqLnd

    yum -y update

    wget http://Nginx.org/download/Nginx-1.9.9.tar.gz

    ./configure \
    --user=www \
    --group=www \
    --prefix=/workspace/app/Nginx \
    --with-pcre \
    --with-http_stub_status_module \
    --with-http_ssl_module \
    --with-http_realip_module \
    --with-http_image_filter_module

    wget -c https://downloads.MysqL.com/archives/get/file/mysql-5.6.25.tar.gz

    cmake \
    -DCMAKE_INSTALL_PREFIX=/workspace/app/MysqL \
    -DMysqL_DATADIR=/workspace/data/MysqL \
    -DSYSconfdIR=/etc \
    -DWITH_MYISAM_STORAGE_ENGINE=1 \
    -DWITH_INNOBASE_STORAGE_ENGINE=1 \
    -DMysqL_UNIX_ADDR=/tmp/MysqLd.sock \
    -DMysqL_TCP_PORT=3306 \
    -DENABLED_LOCAL_INFILE=1 \
    -DWITH_PARTITION_STORAGE_ENGINE=1 \
    -DEXTRA_CHARSETS=all \
    -DDEFAULT_CHARSET=utf8mb4 \
    -DDEFAULT_COLLATION=utf8mb4_unicode_ci

    ./scripts/MysqL_install_db --user=MysqL --datadir=/workspace/data/MysqL

    cp support-files/my-default.cnf /etc/my.cnf

    wget https://www.PHP.net/distributions/PHP-7.1.27.tar.gz

    ./configure \
    --prefix=/workspace/app/PHP/PHP71 \
    --with-config-file-path=/workspace/config/PHP/PHP71/etc \
    --with-MysqLi=/workspace/app/MysqL/bin/MysqL_config \
    --with-MysqLi=MysqLnd \
    --with-pdo-MysqL=MysqLnd \
    --with-iconv \
    --with-freetype-dir \
    --with-jpeg-dir \
    --with-png-dir \
    --with-zlib \
    --with-libxml-dir \
    --enable-xml \
    --disable-rpath \
    --enable-bcmath \
    --enable-shmop \
    --enable-sysvsem \
    --enable-inline-optimization \
    --with-curl \
    --enable-mbregex \
    --enable-fpm \
    --enable-mbstring \
    --with-mcrypt \
    --with-gd \
    --enable-gd-native-ttf \
    --with-openssl \
    --with-mhash \
    --enable-pcntl \
    --enable-sockets \
    --with-xmlrpc \
    --enable-zip \
    --with-bz2 \
    --enable-soap \
    --enable-opcache \
    --with-pdo-MysqL \
    --enable-maintainer-zts \
    --enable-pcntl \
    --enable-shmop \
    --enable-sysvmsg \
    --enable-sysvsem \
    --enable-sysvshm \
    --without-pear \
    --with-gettext \
    --enable-fpm \
    --enable-opcache=no

    #设置环境变量
    PATH=$PATH:$HOME/bin:/workspace/app/MysqL/bin:/workspace/app/MysqL/lib
    
    #制作成服务启动
    cp support-files/MysqL.server /etc/init.d/MysqL
    #相关命令:
        service MysqL start  
        #停止MysqL服务  
        service MysqL stop  
        #重启MysqL服务  
        service MysqL restart
    #添加到开机启动项 chkconfig --add MysqL
    #下面是为了PHP-fpm随系统自启动。
    cp ./sapi/fpm/init.d.PHP-fpm /etc/init.d/PHP-fpm

    未完。。待续。。

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐