Skip to content

Instantly share code, notes, and snippets.

@klauskpm
Forked from jgskin/php_install_ubuntu1210.py
Last active December 12, 2015 04:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klauskpm/4715809 to your computer and use it in GitHub Desktop.
Save klauskpm/4715809 to your computer and use it in GitHub Desktop.
#! /usr/bin/python
""" PHP install script. Tested with ubuntu 12.10"""
import os
ubuntu_packs = [
"mysql-server",
"mysql-client",
"libxml2-dev",
"libicu-dev",
"g++",
"libzzip-dev",
"libcurl4-nss-dev",
"libcurl4-openssl-dev",
"libreadline6-dev",
"autoconf",
]
php_opts = [
"enable-ftp",
"enable-mbstring",
"enable-intl",
"enable-pcntl",
"enable-soap",
"with-mysql",
"with-pdo-mysql",
"with-openssl",
"with-zlib",
"enable-zip",
"with-curl",
"with-readline"
]
# install ubuntu packs
for packname in ubuntu_packs:
os.system("sudo apt-get -y install {0}".format(packname))
# configure PHP
os.system("./configure " + " ".join(["--" + opt for opt in php_opts]))
# build and install PHP
os.system("""
make
sudo make install
""")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment