记一次“愉快”的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

    # 配置nginx支持php
    fastcgi_param SCRIPT_FILENAME $document_root$fasrcgi_script_name
    #设置环境变量
    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

    未完。。待续。。

猜你喜欢

转载自www.cnblogs.com/jjxhp/p/10661025.html
今日推荐