windows子系统安装php

windows子系统安装php

方案一(编译比较慢)
编译安装
可以先安装zsh,进入zsh之后更方便一些
安装zsh
设置

# 查看版本
cat /etc/issue
# Ubuntu 16.04.4 LTS \n \l 
# 编辑源
sudo nano /etc/apt/sources.list
# 修改为
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse 
# 更新
sudo apt-get update
sudo apt-get dist-upgrade
# 编译环境
apt-get install build-essential
# apt-get install libxml2-dev
# apt-get install libaio-dev
# 下载
cd /home/tools
wget http://cn2.php.net/distributions/php-7.1.0.tar.gz
tar zxvf php-7.1.0.tar.gz
cd php-7.1.0
# 参数
./configure \
--prefix=/vhs/php/php71 \
--exec-prefix=/vhs/php/php71 \
--bindir=/vhs/php/php71/bin \
--sbindir=/vhs/php/php71/sbin \
--includedir=/vhs/php/php71/include \
--libdir=/vhs/php/php71/lib \
--mandir=/vhs/php/php71/php/man \
--with-config-file-path=/vhs/php/php71/etc \
--with-mysql-sock \
--with-mcrypt \
--with-mhash \
--with-openssl \
--with-mysqli=shared,mysqlnd \
--with-pdo-mysql=shared,mysqlnd \
--with-gd \
--with-iconv \
--with-zlib \
--enable-zip \
--enable-inline-optimization \
--disable-debug \
--disable-rpath \
--enable-shared \
--enable-xml \
--enable-bcmath \
--enable-shmop \
--enable-sysvsem \
--enable-mbregex \
--enable-mbstring \
--enable-ftp \
--enable-gd-native-ttf \
--enable-pcntl \
--enable-sockets \
--with-xmlrpc \
--enable-soap \
--without-pear \
--with-gettext \
--enable-session \
--with-curl \
--with-jpeg-dir \
--with-freetype-dir \
--enable-opcache \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--without-gdbm \
--disable-fileinfo
# 错误解决
# configure: error: xml2-config not found. Please check your libxml2 installation. 
apt-get install libxml2-dev
# configure: error: Cannot find OpenSSL's <evp.h>
apt-get install build-essential libexpat1-dev libgeoip-dev libpng-dev libpcre3-dev libssl-dev libxml2-dev rcs zlib1g-dev libmcrypt-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libwebp-dev pkg-config
# configure: error: freetype-config not found.
apt-get install libfreetype6-dev
# configure: WARNING: unrecognized options: --with-mysql 
# 删除--with-mysql

# 编译安装
make
make install
# 完成
 ⚡ root@DESKTOP-F6LVIR9  /home/tools/php-7.1.0  make install
# Installing shared extensions:     /vhs/php/php71/lib/extensions/no-debug-non-zts-20160303/
# Installing PHP CLI binary:        /vhs/php/php71/bin/
# Installing PHP CLI man page:      /vhs/php/php71/php/man/man1/
# Installing PHP FPM binary:        /vhs/php/php71/sbin/
# Installing PHP FPM config:        /vhs/php/php71/etc/
# Installing PHP FPM man page:      /vhs/php/php71/php/man/man8/
# Installing PHP FPM status page:   /vhs/php/php71/php/php/fpm/
# Installing phpdbg binary:         /vhs/php/php71/bin/
# Installing phpdbg man page:       /vhs/php/php71/php/man/man1/
# Installing PHP CGI binary:        /vhs/php/php71/bin/
# Installing PHP CGI man page:      /vhs/php/php71/php/man/man1/
# Installing build environment:     /vhs/php/php71/lib/build/
# Installing header files:           /vhs/php/php71/include/php/
# Installing helper programs:       /vhs/php/php71/bin/
#   program: phpize
#   program: php-config
# Installing man pages:             /vhs/php/php71/php/man/man1/
#   page: phpize.1
#   page: php-config.1
# /home/tools/php-7.1.0/build/shtool install -c ext/phar/phar.phar /vhs/php/php71/bin
# ln -s -f phar.phar /vhs/php/php71/bin/phar
# Installing PDO headers:           /vhs/php/php71/include/php/ext/pdo/

猜你喜欢

转载自blog.csdn.net/HD2killers/article/details/82811757
今日推荐