Code Monkey home page Code Monkey logo

install-php56's Introduction

Ubuntu 14.04 编译安装php5.6

0. 预装软件

sudo apt-get update

sudo apt-get install libxml2-dev
sudo apt-get install libjpeg-dev
sudo apt-get install libpng12-dev
sudo apt-get install libfreetype6-dev
sudo apt-get install libcurl4-openssl-dev

安装libxml2-dev

安装libjpeg-dev

安装libpng12-dev

安装libfreetype6-dev

1. 下载PHP5.6.28源码

wget http://cn2.php.net/distributions/php-5.6.28.tar.gz

下载PHP5.6源码

2. 解压并安装

  • 安装路径:/usr/local/php

    tar -zxf php-5.6.28.tar.gz
    cd php-5.6.28
    ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php --enable-mbstring --enable-ftp --with-gd --with-jpeg-dir=/usr --with-png-dir=/usr --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-openssl-dir=/usr --with-openssl --with-pdo-mysql=mysqlnd --with-pear --enable-sockets --with-freetype-dir=/usr --enable-gd-native-ttf --with-zlib --with-libxml-dir=/usr --with-xmlrpc --enable-zip --enable-fpm --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

编译

编译结果

安装

安装结果

3. 配置

  • 复制PHP.INI文件(在PHP源码根目录下)

    sudo cp ./php.ini-development /usr/local/php/
    
    vim /usr/local/php/php.ini
    include_path = /usr/local/php/lib/php
  • 复制启动脚本(在PHP源码根目录下):

     sudo cp ./sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
     sudo chmod+x /etc/init.d/php-fpm
  • 复制PHP-FPM配置文件:

     cd /usr/local/php/etc
     sudo cp php-fpm.conf.default php-fpm.conf
     sudo mv php-fpm.conf.default php-fpm.conf.default.bak
  • 配置PHP-FPM文件

    vim php-fpm.conf
    
    pid = run/php-fpm.pid
    pm.max_children = 5
    pm.start_servers = 2
    pm.min_spare_servers = 1
    pm.max_spare_servers = 3
    

install-php56's People

Contributors

kimpa0107 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.