Cara untuk menyusun dan memasang php7 pada mac: 1. Muat turun PHP melalui "wget -c http://mirrors.sohu.com/php/php-7.1.8.tar.gz"; . Melalui "tar -zxvf php-7.1.8.tar.gz" untuk menyahmampat dan menyusun.
Persekitaran pengendalian artikel ini: sistem macOS10.15, PHP versi 7.1.8, komputer macbook pro 2020.
Bagaimana untuk menyusun dan memasang php7 pada mac?
Menyusun dan memasang PHP7.1.8 pada Mac:
wget -c http://mirrors.sohu.com/php/php-7.1.8.tar.gz
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
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)
configure: error: OpenSSL version 1.0.1 or greater required.
brew install openssl
--with-openssl=/usr/local/Cellar/openssl@1.1/1.1.0e
configure: error: Cannot locate header file libintl.h
brew install gettext
for i in $PHP_GETTEXT /usr/local /usr/ ;do
for i in $PHP_GETTEXT /usr/local /usr/ usr/local/opt/gettext;do
checking for iconv... no checking for libiconv... no configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>
Pasang libiconv (pustaka penukaran pengekodan aksara)
Alamat tapak web: http: //www.gnu.org/software/libiconv/
Versi semasa: https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
$ wget [https://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
Tutorial PHP7》
Atas ialah kandungan terperinci Bagaimana untuk menyusun dan memasang php7 pada mac. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!