mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 05:23:03 +07:00
Install extensions with PHP7.4 on darwin.
This commit is contained in:
parent
16f13a69eb
commit
651d2619bb
95
src/7.4.sh
95
src/7.4.sh
@ -1,50 +1,61 @@
|
|||||||
brew fetch autoconf& brew fetch automake& brew fetch pcre& brew fetch libtool& brew fetch libpng& brew fetch webp& brew fetch jpeg& brew fetch freetype& brew fetch libxml2& brew fetch pkg-config& brew fetch krb5& brew fetch icu4c& brew fetch re2c& brew fetch bison& brew fetch libzip& brew fetch mcrypt& brew fetch zlib& brew fetch bzip2& brew fetch enchant
|
brew install pkg-config autoconf bison re2c openssl krb5 bzip2 enchant libffi libpng webp freetype intltool icu4c libiconv zlib t1lib gd libzip gmp tidyp libxml2 libxslt postgresql >/dev/null 2>&1
|
||||||
brew install autoconf automake pcre libtool libpng webp jpeg freetype libxml2 pkg-config krb5 icu4c re2c bison libzip mcrypt zlib bzip2 enchant > /dev/null 2>&1
|
brew link icu4c gettext --force >/dev/null 2>&1
|
||||||
brew link --force gettext
|
|
||||||
brew link --force bison
|
for package in gettext gmp bzip2 krb5 icu4c bison openssl libxml2 libffi libxslt libiconv pkgconfig enchant kerberos readline libedit freetype;
|
||||||
brew link --force openssl
|
do
|
||||||
brew link --force libxml2
|
caps_package=$(echo "$package" | tr '[:lower:]' '[:upper:]')
|
||||||
brew link --force bzip2
|
{
|
||||||
echo 'export PATH="/usr/local/opt/bzip2/bin:$PATH"' >> ~/.bash_profile
|
echo 'export PATH="/usr/local/opt/'"$package"'/bin:$PATH"'
|
||||||
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
|
echo 'export PKG_CONFIG_PATH="/usr/local/opt/'$package'/lib/pkgconfig:$PKG_CONFIG_PATH"'
|
||||||
echo 'export PATH="/usr/local/opt/krb5/bin:$PATH"' >> ~/.bash_profile
|
echo 'export '"$caps_package"'_LIBS="-L/usr/local/opt/'$package'/lib"'
|
||||||
echo 'export PATH="/usr/local/opt/krb5/sbin:$PATH"' >> ~/.bash_profile
|
echo 'export '"$caps_package"'_CFLAGS="-I/usr/local/opt/'$package'/include"'
|
||||||
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
|
} >> ~/.bash_profile;
|
||||||
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile
|
done
|
||||||
echo 'export PATH="/usr/local/opt/bison/bin:$PATH"' >> ~/.bash_profile
|
{
|
||||||
echo 'export PATH="/usr/local/opt/libxml2/bin:$PATH"' >> ~/.bash_profile
|
echo 'export ICONV_LIBS="-L/usr/local/opt/libiconv/lib"'
|
||||||
echo 'export PATH="/Users/runner/.phpbrew/php/php-7.4.0RC1/bin:$PATH"' >> ~/.bash_profile
|
echo 'export ICONV_CFLAGS="-I/usr/local/opt/libiconv/include"'
|
||||||
source ~/.bash_profile > /dev/null 2>&1
|
echo 'export LIBXML_LIBS="-L/usr/local/opt/libxml2/lib"'
|
||||||
export LIBXML_LIBS="-L/usr/local/opt/libxml2/lib"
|
echo 'export LIBXML_CFLAGS="-I/usr/local/opt/libxml2/include"'
|
||||||
export LIBXML_CFLAGS="-I/usr/local/opt/libxml2/include"
|
echo 'export ICU_LIBS="-L/usr/local/opt/icu4c/lib"'
|
||||||
export ENCHANT_LIBS="-L/usr/local/opt/enchant/lib"
|
echo 'export ICU_CFLAGS="-I/usr/local/opt/icu4c/include"'
|
||||||
export ENCHANT_CFLAGS="-I/usr/local/opt/enchant/include"
|
echo 'export OPENSSL_LIBS="-L/usr/local/Cellar/openssl/1.0.2s/lib -lcrypto"'
|
||||||
export FFI_LIBS="-L/usr/local/opt/libffi/lib"
|
echo 'export OPENSSL_CFLAGS="-I/usr/local/Cellar/openssl/1.0.2s/include"'
|
||||||
export FFI_CFLAGS="-I/usr/local/opt/libffi/include"
|
echo 'export OPENSSL_ROOT_DIR="/usr/local/opt/openssl"'
|
||||||
export ICU_LIBS="-L/usr/local/opt/icu4c/lib"
|
echo 'export OPENSSL_LIB_DIR="/usr/local/opt/openssl/lib"'
|
||||||
export ICU_CFLAGS="-I/usr/local/opt/icu4c/include"
|
echo 'export OPENSSL_INCLUDE_DIR="/usr/local/opt/openssl/include"'
|
||||||
export KERBEROS_LIBS="-L/usr/local/opt/krb5/lib"
|
echo 'export PKG_CONFIG_PATH="/usr/local/Cellar/openssl/1.0.2s/lib/pkgconfig:$PKG_CONFIG_PATH"'
|
||||||
export KERBEROS_CFLAGS="-I/usr/local/opt/krb5/include"
|
echo 'export PKG_CONFIG="/usr/local/opt/pkgconfig/bin/pkg-config"'
|
||||||
export OPENSSL_LIBS="-L/usr/local/opt/openssl/lib"
|
echo 'export EXTRA_LIBS="/usr/local/opt/readline/lib/libhistory.dylib
|
||||||
export OPENSSL_CFLAGS="-I/usr/local/opt/openssl/include"
|
/usr/local/opt/readline/lib/libreadline.dylib
|
||||||
export READLINE_LIBS="-L/usr/local/opt/readline/lib"
|
/usr/local/opt/openssl/lib/libssl.dylib
|
||||||
export READLINE_CFLAGS="-I/usr/local/opt/readline/include"
|
/usr/local/opt/openssl/lib/libcrypto.dylib
|
||||||
export BZIP2_LIBS="-L/usr/local/opt/bzip2/lib"
|
/usr/local/opt/icu4c/lib/libicudata.dylib
|
||||||
export BZIP2_CFLAGS="-I/usr/local/opt/bzip2/include"
|
/usr/local/opt/icu4c/lib/libicui18n.dylib
|
||||||
export PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/obzip2pt/libffi/lib/pkgconfig:/usr/local/opt/openssl@1.1/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/libffi/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig"
|
/usr/local/opt/icu4c/lib/libicuio.dylib
|
||||||
|
/usr/local/opt/icu4c/lib/libicutu.dylib
|
||||||
|
/usr/local/opt/icu4c/lib/libicuuc.dylib"'
|
||||||
|
} >> ~/.bash_profile
|
||||||
|
config_file=$(pwd)/src/config.yaml
|
||||||
cd ~ || echo "could not move to ~"
|
cd ~ || echo "could not move to ~"
|
||||||
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew
|
curl -L -O https://github.com/phpbrew/phpbrew/raw/master/phpbrew >/dev/null 2>&1
|
||||||
chmod +x ./phpbrew
|
chmod +x ./phpbrew
|
||||||
sudo mv phpbrew /usr/local/bin/phpbrew
|
sudo mv phpbrew /usr/local/bin/phpbrew
|
||||||
sudo mkdir -p /opt/phpbrew
|
sudo mkdir -p /opt/phpbrew
|
||||||
phpbrew init --root=/opt/phpbrew
|
sudo phpbrew init --root=/opt/phpbrew --config="$config_file" >/dev/null 2>&1
|
||||||
echo "[[ -e ~/.phpbrew/bashrc ]] && source ~/.phpbrew/bashrc" >> ~/.bashrc
|
sudo chmod -R 777 /opt/phpbrew
|
||||||
source ~/.bashrc
|
export PHPBREW_ROOT=/opt/phpbrew
|
||||||
phpbrew install -j 10 7.4.0RC2 +default +bz2="$(brew --prefix bzip2)" +zlib="$(brew --prefix zlib)" -openssl -- --with-libxml
|
export PHPBREW_HOME=/opt/phpbrew
|
||||||
phpbrew switch php-7.4.0RC2 > /dev/null 2>&1
|
echo "[[ -e ~/.phpbrew/bash_profile ]] && source ~/.phpbrew/bash_profile" >> ~/.bash_profile
|
||||||
|
source ~/.bash_profile >/dev/null 2>&1
|
||||||
|
sudo mkdir -p /usr/local/lib
|
||||||
|
phpbrew install -j 4 7.4.0RC2 +dev
|
||||||
|
tail -40 /opt/phpbrew/build/php-7.4.0RC2/build.log
|
||||||
|
phpbrew switch php-7.4.0RC2
|
||||||
|
phpbrew ext install +dev >/dev/null 2>&1
|
||||||
sudo mkdir -p /usr/local/bin
|
sudo mkdir -p /usr/local/bin
|
||||||
sudo ln -sf /Users/runner/.phpbrew/php/php-7.4.0RC2/bin/php /usr/local/bin/php
|
sudo ln -sf /opt/phpbrew/php/php-7.4.0RC2/bin/* /usr/local/bin/
|
||||||
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
ini_file=$(php --ini | grep "Loaded Configuration" | sed -e "s|.*:s*||" | sed "s/ //g")
|
||||||
ext_dir=$(/usr/bin/php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
pecl config-set php_ini $ini_file
|
||||||
|
ext_dir=$(php -i | grep "extension_dir => /usr" | sed -e "s|.*=> s*||")
|
||||||
sudo chmod 777 "$ini_file"
|
sudo chmod 777 "$ini_file"
|
||||||
brew install composer
|
brew install composer
|
60
src/config.yaml
Normal file
60
src/config.yaml
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
variants:
|
||||||
|
dev:
|
||||||
|
bcmath:
|
||||||
|
calendar:
|
||||||
|
cli:
|
||||||
|
ctype:
|
||||||
|
dom:
|
||||||
|
fileinfo:
|
||||||
|
filter:
|
||||||
|
ipc:
|
||||||
|
iconv:
|
||||||
|
json:
|
||||||
|
mbregex:
|
||||||
|
mbstring:
|
||||||
|
mhash:
|
||||||
|
mcrypt:
|
||||||
|
pcntl:
|
||||||
|
pcre:
|
||||||
|
pdo:
|
||||||
|
phar:
|
||||||
|
posix:
|
||||||
|
sockets:
|
||||||
|
tokenizer:
|
||||||
|
xml:
|
||||||
|
curl:
|
||||||
|
openssl:
|
||||||
|
zip:
|
||||||
|
gd:
|
||||||
|
- --with-freetype
|
||||||
|
- --with-pdo-mysql=mysqlnd
|
||||||
|
- --with-mysqli=mysqlnd
|
||||||
|
- --with-pgsql
|
||||||
|
- --with-pdo-pgsql
|
||||||
|
- --with-gmp=/usr/local/opt/gmp
|
||||||
|
- --with-openssl
|
||||||
|
- --with-pear
|
||||||
|
- --with-zip
|
||||||
|
- --with-zlib-dir=/usr/local/opt/zlib
|
||||||
|
- --with-libxml
|
||||||
|
- --with-kerberos
|
||||||
|
- --with-gd
|
||||||
|
- --with-ffi
|
||||||
|
- --with-bz2=/usr/local/opt/bzip2
|
||||||
|
- --with-readline=/usr/local/opt/readline
|
||||||
|
- --with-iconv=/usr/local/opt/libiconv
|
||||||
|
- --with-icu-dir=/usr/local/opt/icu4c
|
||||||
|
- --enable-intl
|
||||||
|
- --enable-xml
|
||||||
|
- --enable-sysvsem
|
||||||
|
- --enable-sysvshm
|
||||||
|
- --enable-sysvmsg
|
||||||
|
- --enable-phpdbg
|
||||||
|
- --enable-exif
|
||||||
|
- --enable-gd
|
||||||
|
- --enable-soap
|
||||||
|
- --enable-xmlreader
|
||||||
|
- --enable-zend-test=shared
|
||||||
|
extensions:
|
||||||
|
dev:
|
||||||
|
xdebug: stable
|
Loading…
Reference in New Issue
Block a user