最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Centos7.2 編譯安裝PHP7.0.2的步驟

 更新時(shí)間:2017年06月21日 09:48:13   作者:hyperbolaa  
本篇文章主要介紹了Centos7.2 編譯安裝PHP7.0.2的步驟。小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

環(huán)境

  1. 系統(tǒng):Centos7.2 
  2. 服務(wù):Nginx

1:下載PHP7.0.2的安裝包解壓,編譯,安裝:

  $ cd /usr/src/
  $ wget http://cn2.php.net/distributions/php-7.0.2.tar.gz
  $ tar -xzxvf php-7.0.2.tar.gz
  $ cd php-7.0.2

1.1編譯前檢查

請檢查是否安裝了gcc ,沒有的話執(zhí)行yum install gcc

檢查是否安裝了libxml2 ,沒有的話執(zhí)行yum install libxml2

檢查是否安裝了libxml2-devel,沒有的話執(zhí)行yum install libxml2-devel

注:因?yàn)楦臑橛胣ginx了,所以編譯參數(shù)中的--with-apxs2=/usr/bin/apxs去掉了,如果要配置apache用,安裝PHP前,請先安裝apache。*

2:編譯參數(shù)配置

復(fù)制代碼 代碼如下:

'./configure' '--prefix=/usr/local/php' '--with-pdo-pgsql' '--with-zlib-dir' '--with-freetype-dir' '--enable-mbstring' '--with-libxml-dir=/usr' '--enable-soap' '--enable-calendar' '--with-curl' '--with-mcrypt' '--with-gd' '--with-pgsql' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-zlib' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-pcntl' '--enable-mbregex' '--enable-exif' '--enable-bcmath' '--with-mhash' '--enable-zip' '--with-pcre-regex' '--with-pdo-mysql' '--with-mysqli' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--with-openssl' '--with-fpm-user=www-data' '--with-fpm-group=www-data' '--with-libdir=/lib/x86_64-linux-gnu/' '--enable-ftp' '--with-gettext' '--with-xmlrpc' '--with-xsl' '--enable-opcache' '--enable-fpm' '--with-iconv' '--with-xpm-dir=/usr'

3:錯(cuò)誤集合

報(bào)錯(cuò) Cannot find OpenSSL's <evp.h>
 執(zhí)行 yum install openssl openssl-devel

報(bào)錯(cuò) Please reinstall the libcurl distribution
 執(zhí)行 yum -y install curl-devel

錯(cuò)誤 jpeglib.h not found
 執(zhí)行 yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y
 和執(zhí)行 yum install libjpeg-devel

錯(cuò)誤:checking for BZip2 in default path... not found configure: error: Please reinstall the BZip2 distribution 這是bzip2軟件包沒有安裝
 執(zhí)行 yum install bzip2-devel.x86_64 -y

錯(cuò)誤:configure: error: xpm.h not found.
 執(zhí)行 yum install libXpm-devel

錯(cuò)誤: Unable to locate gmp.h
 執(zhí)行 yum install gmp-devel

錯(cuò)誤:Unable to detect ICU prefix or /usr//bin/icu-config failed. Please verify ICU install prefix and make sure icu-config works
 執(zhí)行 yum install -y icu libicu libicu-devel

錯(cuò)誤:mcrypt.h not found. Please reinstall libmcrypt.
 執(zhí)行 yum install php-mcrypt libmcrypt libmcrypt-devel

錯(cuò)誤: configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
 執(zhí)行 yum install postgresql-devel

錯(cuò)誤: configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
 執(zhí)行 yum install libxslt-devel

4:編譯

make clean && make && make install

5:PHP配置

5.1安裝完成后,我們要把源碼包中的配置文件復(fù)制到PHP安裝目錄下,源碼包中有兩個(gè)配置 php.ini-development php.ini-production ,看名字就知道,一個(gè)是開發(fā)環(huán)境,一個(gè)是生產(chǎn)環(huán)境,我們這里就復(fù)制開發(fā)環(huán)境的

cp php.ini-development /usr/local/php/lib/php.ini

5.2另外還需要設(shè)置環(huán)境變量 :修改/etc/profile文件使其永久性生效,并對所有系統(tǒng)用戶生效,在文件末尾加上如下兩行代碼

PATH=$PATH:/usr/local/php/bin
export PATH

5.3 然后執(zhí)行生效命令

source /etc/profile

5.4查看PHP版本信息

php -v

6:配置PHP-fpm

cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

cp /usr/src/php-7.0.2/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm

chmod +x /etc/init.d/php-fpm

6.1 啟動(dòng)php-fpm:

/etc/init.d/php-fpm start

6.2 如果出現(xiàn)錯(cuò)誤:ERROR: [pool www] cannot get uid for user 'www-data'

則新建www-data 用戶組:

groupadd www-data
useradd -g www-data www-data

6.3 重啟php-fpm

/etc/init.d/php-fpm restart

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Apache由http自動(dòng)跳轉(zhuǎn)到https的多種方法

    Apache由http自動(dòng)跳轉(zhuǎn)到https的多種方法

    本文主要和大家分享Apache http自動(dòng)跳轉(zhuǎn)到https的幾種方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友參考下
    2018-02-02
  • ubuntu下迅雷極速版的安裝與使用

    ubuntu下迅雷極速版的安裝與使用

    Ubuntu是一個(gè)完全基于Linux的操作系統(tǒng),它不但免費(fèi),而且有專業(yè)人員和業(yè)余愛好者共同為其提供技術(shù)支持。迅雷極速版的推出吸引了眾多追求速度的網(wǎng)友關(guān)注。那么這篇文章我們就來學(xué)習(xí)下在ubuntu下迅雷極速版與QQ旋風(fēng)的安裝與使用,有需要的朋友們下面來一起看看吧。
    2016-10-10
  • shell腳本批量執(zhí)行ping和telnet測試網(wǎng)絡(luò)方式

    shell腳本批量執(zhí)行ping和telnet測試網(wǎng)絡(luò)方式

    文章介紹了如何通過創(chuàng)建shell腳本來簡化本地網(wǎng)絡(luò)測試任務(wù),包括ping和telnet測試,文章詳細(xì)描述了腳本的創(chuàng)建、編輯、賦予執(zhí)行權(quán)限以及執(zhí)行的步驟,并提供了具體的腳本示例
    2024-12-12
  • ubuntu服務(wù)器環(huán)境下安裝python的方法

    ubuntu服務(wù)器環(huán)境下安裝python的方法

    這篇文章主要介紹了ubuntu服務(wù)器環(huán)境下安裝python的方法,簡單分析了Ubuntu環(huán)境下安裝Python的相關(guān)步驟、命令、與操作注意事項(xiàng),需要的朋友可以參考下
    2018-03-03
  • Linux中使用crontab命令啟用自定義定時(shí)任務(wù)實(shí)例

    Linux中使用crontab命令啟用自定義定時(shí)任務(wù)實(shí)例

    本篇文章主要是介紹了Linux中使用crontab命令啟用自定義定時(shí)任務(wù)實(shí)例,感興趣的小伙伴們可以參考一下。
    2016-10-10
  • linux中install命令和cp命令的使用與區(qū)別

    linux中install命令和cp命令的使用與區(qū)別

    相信大家都知道linux中的命令I(lǐng)nstall和cp類似,都可以將文件/目錄拷貝到指定的地點(diǎn)。下面這篇文章就詳細(xì)介紹了linux中install命令和cp命令的介紹與區(qū)別。有需要的朋友們可以參考借鑒,下面來一起看看吧。
    2017-01-01
  • 解決yum安裝報(bào)錯(cuò)Protected multilib versions的問題

    解決yum安裝報(bào)錯(cuò)Protected multilib versions的問題

    今天小編就為大家分享一篇解決yum安裝報(bào)錯(cuò)Protected multilib versions的問題,具有很好的參考價(jià)值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-07-07
  • Linux下查看binlog文件創(chuàng)建時(shí)間的命令

    Linux下查看binlog文件創(chuàng)建時(shí)間的命令

    這篇文章主要介紹了Linux下查看binlog文件創(chuàng)建時(shí)間的命令,本文給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2019-05-05
  • Linux調(diào)試工具GDB使用簡易教程

    Linux調(diào)試工具GDB使用簡易教程

    這篇文章主要介紹了Linux調(diào)試工具GDB使用簡易教程,小編覺得還是挺不錯(cuò)的,具有一定借鑒價(jià)值,需要的朋友可以參考下
    2018-01-01
  • CentOS 7.4下安裝Oracle 11.2.0.4數(shù)據(jù)庫的方法

    CentOS 7.4下安裝Oracle 11.2.0.4數(shù)據(jù)庫的方法

    本篇文章主要介紹了CentOS 7.4下安裝Oracle 11.2.0.4數(shù)據(jù)庫的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-12-12

最新評(píng)論

甘肃省| 邛崃市| 华池县| 苗栗县| 石楼县| 安丘市| 常熟市| 沙洋县| 长岛县| 海门市| 包头市| 庆城县| 巴南区| 建瓯市| 景东| 长治县| 英吉沙县| 嘉善县| 延长县| 巴南区| 牙克石市| 阿克| 德令哈市| 旬邑县| 嘉善县| 泾阳县| 伊春市| 贵定县| 兴隆县| 鄢陵县| 甘德县| 武冈市| 清原| 静安区| 隆昌县| 沁水县| 天长市| 天全县| 祁连县| 清新县| 浦北县|