如何详细步骤在mac上编译并安装PHP7版本?
- 内容介绍
- 文章标签
- 相关推荐
本文共计481个文字,预计阅读时间需要2分钟。
在Mac上安装PHP 7.1.8的方法如下:
1. 使用命令 `wget -c http://mirrors.sohu.com/php/php-7.1.8.tar.gz` 下载PHP。
2.使用命令 `tar -zxvf php-7.1.8.tar.gz` 解压下载的PHP包。
确保你的操作环境为:macOS 10.15系统,使用PHP 7.1.8版本,运行在MacBook Pro上。
mac编译安装php7的方法:1、通过“wget -c mirrors.sohu.com/php/php-7.1.8.tar.gz”下载PHP;2、通过“tar -zxvf php-7.1.8.tar.gz”解压编译即可。
本文操作环境:macOS10.15系统,PHP7.1.8版,macbook pro 2020电脑。
mac 怎么编译安装 php7?
Mac编译安装PHP7.1.8:
1、下载稳定版本的PHPwget -c mirrors.sohu.com/php/php-7.1.8.tar.gz2、解压编译
tar -zxvf php-7.1.8.tar.gz ./configure --prefix=/usr/local/php/7.1.8 \ --with-config-file-path=/usr/local/php/7.1.8/etc \ --with-config-file-scan-dir=/usr/local/php/7.1.8/etc/conf.d \ --with-apxs2=/usr/sbin/apxs \ --enable-fpm \ --with-fpm-user=www \ --with-fpm-group=www \ --with-mysqli \ --with-pdo-mysql \ --with-iconv-dir \ --with-freetype-dir \ --with-zlib \ --with-jpeg-dir \ --with-png-dir \ --with-libxml-dir=/usr/bin/xml2-config \ --enable-xml \ --disable-rpath \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --enable-mbregex \ --enable-mbstring \ --with-mcrypt \ --enable-ftp \ --with-gd \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --without-pear \ --with-gettext \ --disable-fileinfo \ --enable-maintainer-zts \ --enable-mysqlnd遇到的问题:
- apxs报错的问题
Sorry, I cannot run apxs. Possible reasons follow: 1. Perl is not installed 2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs 3. Apache was not built using --enable-so (the apxs usage page is displayed)
解决方案:查找www.gnu.org/software/libiconv/
当前版本: ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
$ wget [ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz $ tar zxvf libiconv-1.15.tar.gz $ cd libiconv-1.15 $ ./configure --prefix=/usr/local/lib/libiconv $ make $ sudo make install
安装
make && sudo make install
推荐学习:《PHP7教程》
本文共计481个文字,预计阅读时间需要2分钟。
在Mac上安装PHP 7.1.8的方法如下:
1. 使用命令 `wget -c http://mirrors.sohu.com/php/php-7.1.8.tar.gz` 下载PHP。
2.使用命令 `tar -zxvf php-7.1.8.tar.gz` 解压下载的PHP包。
确保你的操作环境为:macOS 10.15系统,使用PHP 7.1.8版本,运行在MacBook Pro上。
mac编译安装php7的方法:1、通过“wget -c mirrors.sohu.com/php/php-7.1.8.tar.gz”下载PHP;2、通过“tar -zxvf php-7.1.8.tar.gz”解压编译即可。
本文操作环境:macOS10.15系统,PHP7.1.8版,macbook pro 2020电脑。
mac 怎么编译安装 php7?
Mac编译安装PHP7.1.8:
1、下载稳定版本的PHPwget -c mirrors.sohu.com/php/php-7.1.8.tar.gz2、解压编译
tar -zxvf php-7.1.8.tar.gz ./configure --prefix=/usr/local/php/7.1.8 \ --with-config-file-path=/usr/local/php/7.1.8/etc \ --with-config-file-scan-dir=/usr/local/php/7.1.8/etc/conf.d \ --with-apxs2=/usr/sbin/apxs \ --enable-fpm \ --with-fpm-user=www \ --with-fpm-group=www \ --with-mysqli \ --with-pdo-mysql \ --with-iconv-dir \ --with-freetype-dir \ --with-zlib \ --with-jpeg-dir \ --with-png-dir \ --with-libxml-dir=/usr/bin/xml2-config \ --enable-xml \ --disable-rpath \ --enable-bcmath \ --enable-shmop \ --enable-sysvsem \ --enable-inline-optimization \ --with-curl \ --enable-mbregex \ --enable-mbstring \ --with-mcrypt \ --enable-ftp \ --with-gd \ --enable-gd-native-ttf \ --with-openssl \ --with-mhash \ --enable-pcntl \ --enable-sockets \ --with-xmlrpc \ --enable-zip \ --enable-soap \ --without-pear \ --with-gettext \ --disable-fileinfo \ --enable-maintainer-zts \ --enable-mysqlnd遇到的问题:
- apxs报错的问题
Sorry, I cannot run apxs. Possible reasons follow: 1. Perl is not installed 2. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs 3. Apache was not built using --enable-so (the apxs usage page is displayed)
解决方案:查找www.gnu.org/software/libiconv/
当前版本: ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
$ wget [ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz $ tar zxvf libiconv-1.15.tar.gz $ cd libiconv-1.15 $ ./configure --prefix=/usr/local/lib/libiconv $ make $ sudo make install
安装
make && sudo make install
推荐学习:《PHP7教程》

