■ PHP 5.3.29 をインストール ※デフォルトの libphp5.so が消えます。
# phpenv install 5.3.29
++++++++++++++++++++++++++++++
—————–
| BUILD ERROR |
—————–
Here are the last 10 lines from the log:
—————————————–
/tmp/php-build/source/5.3.29/Zend/zend_objects.c:96: 警告: assignment discards qualifiers from pointer target type
/tmp/php-build/source/5.3.29/Zend/zend_object_handlers.c: In function ‘zend_get_property_guard’:
/tmp/php-build/source/5.3.29/Zend/zend_object_handlers.c:301: 警告: passing argument 3 of ‘zend_unmangle_property_name’ from incompatible pointer type
/tmp/php-build/source/5.3.29/Zend/zend_compile.h:576: note: expected ‘char **’ but argument is of type ‘const char **’
/tmp/php-build/source/5.3.29/Zend/zend_object_handlers.c:301: 警告: passing argument 4 of ‘zend_unmangle_property_name’ from incompatible pointer type
/tmp/php-build/source/5.3.29/Zend/zend_compile.h:576: note: expected ‘char **’ but argument is of type ‘const char **’
/tmp/php-build/source/5.3.29/Zend/zend_object_handlers.c:304: 警告: assignment discards qualifiers from pointer target type
/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
make: *** [sapi/fpm/php-fpm] エラー 1
—————————————–
++++++++++++++++++++++++++++++
■ ライブラリが足らないようなのでインストールする
# yum install libtool-ltdl
# yum install libtool-ltdl-devel
■ 再度インストール
# phpenv install 5.3.29
++++++++++++++++++++++++++++++
configure: error:
+————————————————————————————+
| *** ATTENTION *** |
| |
| You’ve configured multiple SAPIs to be build. You can build only |
| one SAPI module and CLI binary at the same time. |
+————————————————————————————+
++++++++++++++++++++++++++++++
■PHP5.3だけ? CGIとCLIを同時に出来ないようなので、configureオプションを外します。
# vi /root/.phpenv/plugins/php-build/share/php-build/definitions/5.3.29
++++++++++++++++++++++++++++++ 先頭に追記
configure_option -D “–enable-cgi”
configure_option -D “–enable-fpm”
++++++++++++++++++++++++++++++
■ 再度インストール
# phpenv install 5.3.29
■ 通常のPHPをインストールした場所に libphp5.so が生成されるので、コピーします。
# cp /usr/lib64/httpd/modules/libphp5.so /root/.phpenv/versions/5.3.29/libphp5.so
# phpenv rehash
■インストールしたPHPを使用します。
# phpenv versions
# phpenv global 5.3.29
# phpenv rehash
# php -v
++++++++++++++++++++++++++++++
PHP 5.3.29 (cli)
++++++++++++++++++++++++++++++