centos下部署php7 php7 apache php7 mysql php7apache2 4.dl

來源:互聯網
上載者:User
data-id="1190000005005068" data-license="cc">

59store erp環境標準化

1.why to be standard

分析歸納前幾個月來發布過程當中遇到的問題,dev,qa,stage,product 4個環境配置並非都一樣,導致

內網測試各環境通過但在生產環境還是會跪,未永絕後患,故聯合悟飯整理一個erp的標準php環境,整理

完經過測試後,將dev,qa,stage,product環境全部統一。

2.PHP版本選擇(7.0)

為何選擇php7

  • php之父曰:能比前一版PHP 5快上一倍

  • 團隊使用laravel架構對高版本PHP相容性友好

  • 大家可以使用PHP7新特性,有助於我們跟上節奏

PHP(7.0)在CentOs下的安裝

1.下載

wget -O php-7.0.5.tar.gz http://cn2.php.net/get/php-7.0.5.tar.gz/from/this/mirror

2.安裝開發包和依賴庫

  • 安裝development tools

    `yum groupinstall development tools`
  • 安裝yum擴充

    1.`rpm -ivh http://mirrors.sohu.com/fedora-epel/6/i386/epel-release-6-8.noarch.rpm`2.`yum update`
  • 安裝PHP支援庫

       yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel php-mcrypt

3.編譯PHP7.0

  • 編譯參數

       './configure'  '--prefix=/usr/local/php' '--with-config-file-path=/usr/local/php/etc' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-iconv-dir' '--with-freetype-dir=/usr/local/freetype' '--with-jpeg-dir' '--with-png-dir' '--with-zlib' '--with-libxml-dir=/usr' '--enable-xml' '--disable-rpath' '--enable-bcmath' '--enable-shmop' '--enable-sysvsem' '--enable-inline-optimization' '--with-curl' '--enable-mbregex' '--enable-mbstring' '--with-mcrypt' '--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-openssl' '--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc' '--enable-zip' '--enable-soap' '--with-gettext' '--disable-fileinfo' '--enable-opcache'
  • make && make install

make && make install

4.配置PHP-FPM

  • 增加使用者&使用者組

    1. groupadd www

    2. useradd -g www www

  • 拷貝php-fpm.conf檔案
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

  • 拷貝php-fpm include檔案
    cp usr/local/php/etc/php-fpm.d/ww.conf.default www.conf

  • 拷貝php.ini
    cp php.ini-production /usr/local/php/etc/php.ini

5.將php加入環境變數

1.vi /etc/profile

2.PATH=$PATH:/usr/local/php/bin

3.export PATH

4.source /etc/profile

6.php-fpm自啟動

  • 1.拷貝
    cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

  • 加入系統啟動項

    chkconfig php-fpm on

7.重啟php

  • service php-fpm restart

以上就介紹了centos下部署php7,包括了centos,php7方面的內容,希望對PHP教程有興趣的朋友有所協助。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.