zoukankan      html  css  js  c++  java
  • 源码安装php7.2

    `# 安装依赖包
    yum install -y gcc gcc-c++  make zlib zlib-devel pcre pcre-devel  
    libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel  
    libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel 
    ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel  krb5-devel 
    openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers
    
    
    `# 下载源码包
    wget -c http://mirrors.sohu.com/php/php-7.2.13.tar.gz
    
    
    `# 解压
    tar -xzvf  php-7.2.13.tar.gz
    cd php-7.2.13
    
    
    `# 预编译
    ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php  
    --enable-mbstring --with-openssl --enable-ftp --with-gd --with-jpeg-dir=/usr  
    --with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd  
    --with-pear --enable-sockets --with-freetype-dir=/usr --with-zlib --with-libxml-dir=/usr  
    --with-xmlrpc --enable-zip --enable-fpm --enable-xml --enable-sockets --with-gd --with-zlib 
    --with-iconv --enable-zip --with-freetype-dir=/usr/lib/ --enable-soap --enable-pcntl --enable-cli --with-curl
    
    
    `# 编译并安装
    make && make install
    
    
    `# 拷贝配置文件和启动脚本
    cp php.ini-development /usr/local/php/etc/php-fpm.ini
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
    cp /root/php-7.2.25/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
    chmod o+x /etc/init.d/php-fpm
    
    
    `# 将php服务加入systemctl
    `#(1)自定义添加启动服务文件
    vim /usr/lib/systemd/system/php-fpm.service
    [Unit]
    Description=The PHP FastCGI Process Manager
    After=syslog.target network.target
    
    [Service]
    Type=simple
    PIDFile=/run/php-fpm.pid
    ExecStart=/usr/local/php/sbin/php-fpm --nodaemonize --fpm-config /usr/local/php/etc/php-fpm.conf
    ExecReload=/bin/kill -USR2 $MAINPID
    ExecStop=/bin/kill -SIGINT $MAINPID
    
    [Install]
    WantedBy=multi-user.target
    
    
    `#(2)添加环境变量
    export PATH="$PATH:/usr/local/php/sbin"
    
    
    `#(3)在php.ini解析文件中加入
    vim /usr/local/php/etc/php.ini
    zend_extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20170718/opcache.so
    
    
  • 相关阅读:
    成功,离你只有一步之遥
    多灾多难!危机下给企业家们的十大贴心忠告
    《赢道:成功创业者的28条戒律》 简介:
    面对大面积失业潮,普通人有无必要创业?
    赢在行动《越狱》给创业者的启示
    如何优选创业项目、产品和服务
    你是高执行力人才吗?
    创业新闻] 2009年创业者必读的十一本书(转)
    赢在2009 创业者需练好六脉神剑(转)
    相当受用!10个从实质上迅速提升经理人生活的方法
  • 原文地址:https://www.cnblogs.com/IMSCZ/p/11997206.html
Copyright © 2011-2022 走看看