【摘要】 ubuntu编译安装php7考必过小编为大家整理了关于ubuntu编译安装php7的信息,希望可以帮助到大家!
ubuntu编译安装php7
标签:sock 设置 -o pcntl 编译 xmlrpc php-fpm zlib soc
一、安装依赖
[email protected]:/tmp# apt-get update
[email protected]:/tmp# apt install gcc
[email protected]:/tmp# apt install make
[email protected]:/tmp# apt install openssl
[email protected]:/tmp# apt install curl
[email protected]:/tmp# apt install libbz2-dev
[email protected]:/tmp# apt install libxml2-dev
[email protected]:/tmp# apt install libjpeg-dev
[email protected]:/tmp# apt install libpng-dev
[email protected]:/tmp# apt install libfreetype6-dev
[email protected]:/tmp# apt install libzip-dev
[email protected]:/tmp# apt install libssl-dev
二、下载php包
[email protected]:/tmp# wget http://am1.php.net/distributions/php-7.2.12.tar.gz
[email protected]:/tmp# tar -zxvf php-7.2.12.tar.gz
[email protected]:/tmp# cd php-7.2.12/
三、安装
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --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-dir=/usr/bin/curl --enable-mbregex --enable-mbstring --enable-ftp --with-gd --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts
make
make install
四、配置
cp php.ini-development /usr/local/php/etc/php.ini
cd /usr/local/etc/
cp php-fpm.conf.default php-fpm.conf
cd php-fpm.d
cp www.conf.default www.conf
groupadd www
useradd -g www www
五、启动php-fpm
/usr/local/php/sbin/php-fpm
六、设置PHP执行命令
1.vim /etc/profile
在最后加入以下内容
PATH=$PATH:/usr/local/php/bin
export PATH
2.执行以下命令:
source /etc/profile
php -v
ubuntu编译安装php7
标签:sock 设置 -o pcntl 编译 xmlrpc php-fpm zlib soc
以上就是ubuntu编译安装php7的内容,更多资讯请及时关注考必过网站,最新消息小编会第一时间发布,大家考试加油!