Grav CMS System(1)Install PHP7 on MAC
GravCMSSystem(1)InstallPHP7onMAC
DownloadthelatestPHP7
https://secure.php.net/downloads.php
Idownloadthelatestversion
http://am1.php.net/distributions/php-7.2.11.tar.gz
UnzipthefileandIgetphp-7.2.11
Buildthesourcefile
>./buildconf
Itissaid
Youshouldnotrunbuildconfinareleasepackage.
usebuildconf--forcetooverridethischeck.
Ok,Iwillignorethatandgotothesecondsteps.
>./configure--prefix=/Users/hluo/tool/php-7.2.11--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--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
Exception:
configure:WARNING:unrecognizedoptions:--with-mcrypt,--enable-gd-native-ttf
checkingforcURLindefaultpath...notfound
configure:error:Pleasereinstallthelibcurldistribution-
easy.hshouldbein<curl-dir>/include/curl/
Solution:
https://blog.csdn.net/towtotow/article/details/78956086
Forthewarning,justdeleteoptions—with-mcryptand—enable-gd-native-ttf
https://curl.haxx.se/libcurl/
Igetthelatestfile
>wgethttps://curl.haxx.se/download/curl-7.61.1.tar.gz
configure&&make&&sudomakeinstall
ItsolvedthelibCURLissue.
Exception
checkingwhethertoenableJIS-mappedJapanesefontsupportinGD...no
Ifconfigurefailstry--with-webp-dir=<DIR>
configure:error:jpeglib.hnotfound.
Solution:
http://mac-dev-env.patrickbougie.com/libjpeg/
http://libjpeg.sourceforge.net/
>wgethttps://phoenixnap.dl.sourceforge.net/project/libjpeg/libjpeg/6b/jpegsrc.v6b.tar.gz
Unzipandconfigureandmakeandmakeinstall
Thisdoesnotwork,tryothersolution.
https://gist.github.com/darul75/9125097
>brewinstalllibjpeg
Thisworks
https://github.com/stewartlord/identicon.js/issues/21
>xcode-select--install
>brewinstallpkgconfig
>brewinstallpixman
>brewinstalllibjpeg
>brewlinkjpeg
>brewlink--overwritejpeg
>brewinstallgiflib
>brewinstallcairo
>exportLDFLAGS="-L/usr/local/opt/libffi/lib"
Exception:
configure:error:Cannotlocateheaderfilelibintl.h
Solution:
https://stackoverflow.com/questions/14940383/how-to-install-gettext-on-macos-x
>brewinstallgettext
>brewlink--forcegettext
Exception:
checkingforlibiconv...no
configure:error:Pleasespecifytheinstallprefixoficonvwith--with-iconv=<DIR>
Solution:
http://www.gnu.org/software/libiconv/#downloading
>wgethttps://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz
configureandmakeandsudomakeinstallthat.
GoonwithPHPsteps
>./configure--prefix=/Users/hluo/tool/php-7.2.11--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--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
Errorwhenmakeruns
Undefinedsymbolsforarchitecturex86_64:
"_libiconv",referencedfrom:
_do_convertingdkanji.o
_zif_iconv_substriniconv.o
_zif_iconv_mime_encodeiniconv.o
_php_iconv_stringiniconv.o
__php_iconv_strleniniconv.o
__php_iconv_strposiniconv.o
__php_iconv_appendliniconv.o
…
"_libiconv_open",referencedfrom:
_do_convertingdkanji.o
_zif_iconv_substriniconv.o
_zif_iconv_mime_encodeiniconv.o
_php_iconv_stringiniconv.o
__php_iconv_strleniniconv.o
__php_iconv_strposiniconv.o
__php_iconv_mime_decodeiniconv.o
...
ld:symbol(s)notfoundforarchitecturex86_64
clang:error:linkercommandfailedwithexitcode1
[sapi/cli/php]Error1
Solution:
https://jzz.moe/mac-e7-bc-96-e8-af-91php7-e6-97-b6-e5-bc-95-e5-85-a5openssl-e6-97-b6-e7-9a-84-e9-94-99-e8-af-afundefined-symbols-for-architecture-x86_64/
http://www.voidcn.com/article/p-zvhevcwx-nh.html
https://blog.csdn.net/ligaofeng/article/details/52674696
Tryinstall
http://mac-dev-env.patrickbougie.com/openssl/
Notworkasexpect
>brewinstalllibiconv
>brewlinklibiconv
>exportLDFLAGS="-L/usr/local/opt/libiconv/lib"
>exportCPPFLAGS="-I/usr/local/opt/libiconv/include"
TrytofindonelineinMakefile,changethatasfollow:
EXTRA_LIBS=-lz-lresolv-liconv-liconv-lintl-lpng-lz-ljpeg-lz-lm-lpthread-lxml2-lz-licucore-lm-lcurl-lxml2-lz-licucore-lm-lfreetype-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm/usr/local/Cellar/openssl/1.0.2n/lib/libcrypto.dylib/usr/local/Cellar/openssl/1.0.2n/lib/libssl.dylib
/usr/local/Cellar/libiconv/1.15/lib/libiconv.dylib
No,nottherightone,tryanother
EXTRA_LIBS=-lz-lresolv-liconv-liconv-lintl-lpng-lz-ljpeg-lz-lm-lpthread-lxml2-lz-licucore-lm-lcurl-lxml2-lz-licucore-lm-lfreetype-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm-lxml2-lz-licucore-lm/usr/local/Cellar/libiconv/1.15/lib/libiconv.dylib-lssl-lcrypto
Finallythemakecommandandmakeinstallcommandworks.
Checktheinstallation
>php-version
PHP7.2.11(cli)(built:Oct23201808:40:58)(ZTS)
Copyright(c)1997-2018ThePHPGroup
ZendEnginev3.2.0,Copyright(c)1998-2018ZendTechnologies
References:
https://getgrav.org/
http://www.xuxiaobo.com/?p=3779
https://learn.getgrav.org/
https://github.com/getgrav/grav
https://www.jianshu.com/p/25354b712727
PHPandFPM
https://lowendbox.com/blog/php-on-centos-7-php-fpm/
https://wizardforcel.gitbooks.io/nginx-doc/content/Text/6.5_nginx_php_fpm.html
Mac
https://www.jianshu.com/p/907eec663cf1