Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (24 sloc) 1.04 KB
if [ -z "$PHP_VERSION" ]; then
echo "Usage: <PHP version>"
exit 1
# Update packages and install needed compilation dependencies
sudo yum update -y
sudo yum install autoconf bison gcc gcc-c++ libcurl-devel libxml2-devel -y
# Compile OpenSSL v1.0.1 from source, as Amazon Linux uses a newer version than the Lambda Execution Environment, which
# would otherwise produce an incompatible binary.
curl -sL | tar -xvz
cd openssl-1.0.1k
./config && make && sudo make install
cd ~
# Download the PHP 7.3.0 source
mkdir ~/php-7-bin
curl -sL${PHP_VERSION}.tar.gz | tar -xvz
cd php-src-php-${PHP_VERSION}
# Compile PHP 7.3.0 with OpenSSL 1.0.1 support, and install to /home/ec2-user/php-7-bin
./buildconf --force
./configure --prefix=/home/ec2-user/php-7-bin/ --with-openssl=/usr/local/ssl --with-curl --with-zlib
make install