CentOS安装PHP
来源:互联网 发布:天涯明月刀心法数据 编辑:程序博客网 时间:2024/06/05 02:37
去 PHP 官网下载最新的稳定包 http://php.net/downloads.php , 我下载的是 php-7.1.12.tar.gz
解压安装包 :
# tar -zxvf php-7.1.12.tar.gz
进入解压目录 :
# cd php-7.1.12/
安装依赖包 :
# yum install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel \ libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel \ gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel
编译配置 :
如果出现错误 , 基本都是上一步的依赖文件没有安装所致
./configure \--prefix=/usr/local/php \--with-config-file-path=/etc \--enable-fpm \--with-fpm-user=nginx \--with-fpm-group=nginx \--enable-inline-optimization \--disable-debug \--disable-rpath \--enable-shared \--enable-soap \--with-libxml-dir \--with-xmlrpc \--with-openssl \--with-mcrypt \--with-mhash \--with-pcre-regex \--with-sqlite3 \--with-zlib \--enable-bcmath \--with-iconv \--with-bz2 \--enable-calendar \--with-curl \--with-cdb \--enable-dom \--enable-exif \--enable-fileinfo \--enable-filter \--with-pcre-dir \--enable-ftp \--with-gd \--with-openssl-dir \--with-jpeg-dir \--with-png-dir \--with-zlib-dir \--with-freetype-dir \--enable-gd-native-ttf \--enable-gd-jis-conv \--with-gettext \--with-gmp \--with-mhash \--enable-json \--enable-mbstring \--enable-mbregex \--enable-mbregex-backtrack \--with-libmbfl \--with-onig \--enable-pdo \--with-mysqli=mysqlnd \--with-pdo-mysql=mysqlnd \--with-zlib-dir \--with-pdo-sqlite \--with-readline \--enable-session \--enable-shmop \--enable-simplexml \--enable-sockets \--enable-sysvmsg \--enable-sysvsem \--enable-sysvshm \--enable-wddx \--with-libxml-dir \--with-xsl \--enable-zip \--enable-mysqlnd-compression-support \--with-pear \--enable-opcache
编译安装 :
# make# make install
配置环境变量 :
# vim /etc/profile
在末尾追加
PATH=$PATH:/usr/local/php/bin
执行命令使得改动立即生效
# source /etc/profile
配置 php-fpm , 在当前目录下.../php-7.1.12
:
# cp php.ini-production /etc/php.ini# 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 sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm# chmod +x /etc/init.d/php-fpm
启动 php-fpm :
# /etc/init.d/php-fpm start
安装完成
作者 Github : tojohnonly , 博客 : EnskDeCode
阅读全文
0 0
- centOS 自动安装php
- CentOS 安装PHP-PEAR
- CentOS源码安装PHP
- CentOS 安装 PHP
- CentOS下安装php
- CentOS 源码安装PHP
- Centos 安装PHP
- Centos PHP 安装
- centos源码安装PHP
- centos下安装php
- centos下php安装
- php 安装ImageMagick centos
- Centos下安装php
- centos编译安装PHP
- CentOS安装php
- centos下安装php
- centos 安装php
- centos php安装
- 作业5.5
- hdu 5919 主席树(区间不同数个数+区间第k个数)
- Codeforces 841D Leha and another game about graph(dfs)
- hdoj 1754 I Hate It
- 获取浏览器地址栏ip
- CentOS安装PHP
- Kotlin的语法糖 thread { } 会运行两次的问题【重大BUG预警!】
- Qt中layout()->setSizeConstraint(QLayout::SetFixedSize);崩溃的问题
- 7.4
- C++类构造函数初始化列表详解
- 算法提高 林丹大战李宗伟
- XTU1255 勾股数
- TLS
- 20171130学习笔记之DDL、DML和DCL之见的区别