今からお前んちこいよ

ベルリンにて細々とお勉強。

phpenv 環境で PECL モジュールをインストール

phpenv上の php7.1.9 に yaml の PECL モジュールをインストールしたのでメモ。

環境

  • phpenv:
  • php 7.1.9

インストール

PECLモジュールをダウンロード

https://pecl.php.net/package/yaml

ダウンロードしたPECLモジュールフォルダにphpenvでphpバージョンを適応し、phpizeコマンドがphpenvのものである状態にする

[shi-mans-MBP]
     >>> [yaml-2.0.4] $ cd yaml-2.0.4/
[shi-mans-MBP]
     >>> [yaml-2.0.4] $ phpenv local 7.1.9
[shi-mans-MBP]
     >>> [yaml-2.0.4] $ cd yaml-2.0.4/
[shi-mans-MBP]
     >>> [yaml-2.0.4] $ php -v
PHP 7.1.9 (cli) (built: Feb 22 2018 19:51:36) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.1.9, Copyright (c) 1999-2017, by Zend Technologies
    with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans
[shi-mans-MBP]
     >>> [yaml-2.0.4] $ which phpize
/Users/shi-man/.phpenv/shims/phpize

configure

[shi-mans-MBP]
     >>> [yaml-2.0.4] $ phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
[shi-mans-MBP]
     >>> [yaml-2.0.4] $ ./configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
   ...

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h

make

[shi-mans-MBP]
     >>> [yaml-2.0.4] $ make
/bin/sh /Users/shi-man/Downloads/yaml-2.0.4/yaml-2.0.4/libtool --mode=compile cc  -I. -I/Users/shi-man/Downloads/yaml-2.0.4/yaml-2.0.4 -DPHP_AT
OM_INC -I/Users/shi-man/Downloads/yaml-2.0.4/yaml-2.0.4/include -I/Users/shi-man/Downloads/yaml-2.0.4/yaml-2.0.4/main -I/Users/shi-man/Download
s/yaml-2.0.4/yaml-2.0.4 -I/Users/shi-man/.phpenv/versions/7.1.9/include/php -I/Users/shi-man/.phpenv/versions/7.1.9/include/php/main -I/Users/s
hi-man/.phpenv/versions/7.1.9/include/php/TSRM -I/Users/shi-man/.phpenv/versions/7.1.9/include/php/Zend -I/Users/shi-man/.phpenv/versions/7.1.9
/include/php/ext -I/Users/shi-man/.phpenv/versions/7.1.9/include/php/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /Users/shi
-man/Downloads/yaml-2.0.4/yaml-2.0.4/yaml.c -o yaml.lo
mkdir .libs
   ....

----------------------------------------------------------------------
Libraries have been installed in:
   /path/to/directory/yaml-2.0.4/yaml-2.0.4/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `DYLD_LIBRARY_PATH' environment variable
     during execution

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

make test

[shi-mans-MBP]
     >>> [yaml-2.0.4] $ make test

Build complete.
Don't forget to run 'make test'.


=====================================================================
PHP         : /Users/shi-man/.phpenv/versions/7.1.9/bin/php
PHP_SAPI    : cli
PHP_VERSION : 7.1.9
ZEND_VERSION: 3.1.0
PHP_OS      : Darwin - Darwin shi-mans-MBP.fritz.box 16.4.0 Darwin Kernel Version 16.4.0: Thu Dec 22 22:53:21 PST 2016; root:xnu-3789.41.3~3/RE
LEASE_X86_64 x86_64
INI actual  : /Users/shi-man/Downloads/yaml-2.0.4/yaml-2.0.4/tmp-php.ini
More .INIs  :
   ...

Posting to http://qa.php.net/buildtest-process.php

Thank you for helping to make PHP better.

make install

[shi-mans-MBP]
     >>> [yaml-2.0.4] $ make install
Installing shared extensions:     /Users/shi-man/.phpenv/versions/7.1.9/lib/php/extensions/no-debug-non-zts-20160303/

これで phpenv で yaml が使える。