using phpenv and php-build for travis-ci

reference :

주의할 점은 phpenv local 로 버젼을 변경했을때 해당 폴더의 .php-version 파일로 버젼 확정이 된다는 것이다. 이 것으로 폴더마다 php 버젼을 다르게 할 수 있다.

그리고 /usr/local/share/php-build/default_configure_options 을 수정하면 세세한 php compile 옵션을 조정할 수 있다.

case : ubuntu 14.04LTS

git clone https://github.com/CHH/phpenv

phpenv/bin/phpenv-install.sh

Edit ~/.profile

export PATH="/home/vagrant/.phpenv/bin:$PATH"
eval "$(phpenv init -)"
source ~/.profile

phpenv --version
git clone git://github.com/php-build/php-build.git

sudo php-build/install.sh

php-build --version

case ubuntu:

sudo yum install build-essential
sudo apt-get install autoconf make re2c bison 
sudo apt-get install libxml2-dev libssl-dev libbz2-dev libcurl3-dev libdb5.1-dev libjpeg-dev libpng-dev libXpm-dev libfreetype6-dev libt1-dev libgmp3-dev libc-client-dev libldap2-dev libmcrypt-dev libmhash-dev freetds-dev libz-dev libmysqlclient-dev ncurses-dev libpcre3-dev unixODBC-dev postgresql-server-dev-all libsqlite-dev libaspell-dev libreadline6-dev librecode-dev libsnmp-dev libtidy-dev libxslt-dev libt1-dev libcurl4-openssl-dev libicu-dev

case centos7:
sudo yum install epel-release
sudo yum groupinstall 'Development Tools'
sudo yum install re2c
sudo yum install libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel libXpm-devel freetype-devel readline-devel libxslt-devel  bzip2-devel libmcrypt-devel mariadb-devel libicu-devel
# php defintions
php-build --definitions

# install php 5.3-6, 7
php-build -i development 5.3.29 $HOME/.phpenv/versions/5.3.29
php-build -i development 5.4.45 $HOME/.phpenv/versions/5.4.45
php-build -i development 5.5.38 $HOME/.phpenv/versions/5.5.38
php-build -i development 5.6.25 $HOME/.phpenv/versions/5.6.25
php-build -i development 7.0.10 $HOME/.phpenv/versions/7.0.10
# php versions
phpenv versions

# change php version
cd ~
phpenv rehash
phpenv local 5.4.45

글쓴이

yupmin

Inside Deep Throat.

답글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다.