linux編譯安裝php7.2

來源:互聯網
上載者:User
這篇文章主要介紹了關於linux編譯安裝php7.2,有著一定的參考價值,現在分享給大家,有需要的朋友可以參考一下

php編譯安裝

添加使用者

useradd -r -s /sbin/nologin php-fpm

下載解壓安裝包

cd /data/pkgwget http://php.net/get/php-7.2.2.tar.gz/from/this/mirror mv mirror php-7.2.2.tar.gztar zxvf php-7.2.2.tar.gzcd php-7.2.2

安裝依賴

yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel freetype-devel libmcrypt-devel libxslt libicu-devel libxslt-devel

編譯安裝

./configure \--prefix=/usr/local/php-7.2.2 \--with-mhash \--with-openssl \--with-config-file-path=/usr/local/php-7.2.2/etc \--disable-short-tags \--enable-fpm \--with-fpm-user=php-fpm --with-fpm-group=php-fpm \--enable-xml \--with-libxml-dir \--enable-bcmath \--enable-calendar \--enable-intl \--enable-mbstring \--enable-pcntl \--enable-shmop \--enable-soap \--enable-sockets \--enable-zip \--enable-mbregex \--enable-mysqlnd \--enable-mysqlnd-compression-support \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-gd \--enable-ftp \--with-curl \--with-xsl \--with-iconv \--with-freetype-dir \--with-jpeg-dir \--with-png-dir \--with-zlib \--enable-sysvsem \--enable-inline-optimization \--with-xmlrpc \--with-gettextmake -j 4 && make install

建立軟鏈

ln -s /usr/local/php-7.2.2/ /usr/local/phpln -s /usr/local/php/bin/php /usr/local/binln -s /usr/local/php/sbin/php-fpm /usr/local/sbin

對php-fpm運行使用者進行設定

cd /data/pkg/php-7.2.2cp ./php.ini-development ./php.ini-production /usr/local/php/etccp /usr/local/php/etc/php.ini-development /usr/local/php/etc/php.inicp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.confcp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

建立軟鏈

ln -s /usr/local/php/etc/php.ini /usr/local/etc/ln -s /usr/local/php/etc/php-fpm.conf /usr/local/etc/ln -s /usr/local/php/etc/php-fpm.d/www.conf /usr/local/etc/

配置環境變數,加入全域命令

vim /etc/profilePATH=$PATH:/usr/local/php/binexport PATHsource /etc/profile

啟動php-fpm 服務

/usr/local/sbin/php-fpm

查看是否啟動

netstat -lnt | grep 9000

殺死php-fpm

killall php-fpm

以上就是本文的全部內容,希望對大家的學習有所協助,更多相關內容請關注topic.alibabacloud.com!

相關推薦:

linux編譯安裝mysql5.7

PHP7.2 Data Structures的使用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.