Skip to content

Instantly share code, notes, and snippets.

@harikt
Created January 5, 2012 18:47
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save harikt/1566608 to your computer and use it in GitHub Desktop.
Save harikt/1566608 to your computer and use it in GitHub Desktop.
Compile and Install PHP 5.4 from Source
#Download Apache and extract it
$ ./configure --help
#You will get a list of options, run with enable-so
$ ./configure --enable-so
$ make
$ make install
# Now you can start and stop apache.
# Download php source from github.com or php.net . Extract it and run
$ ./configure --enable-mysqlnd --with-apxs2=/usr/local/apache2/bin/apxs
--disable-ipv6 --with-openssl --with-zlib --enable-bcmath --with-bz2
--with-curl --enable-exif --enable-ftp --with-gd --enable-gd-native-ttf
--with-imap-ssl --with-ldap --enable-mbstring --with-mcrypt
--with-mhash --with-mysql --with-mysqli --enable-pcntl
--with-pdo-mysql --with-pdo-sqlite --enable-shmop --enable-soap
--enable-sockets --with-xmlrpc --with-xsl
# Feel free to remove the ones you don't need :-) , probably ldap , soap etc.
$ make
$ make install
# Remember to symbolic link /usr/bin/php to /usr/local/bin/php .
@tarikwaleed
Copy link

in my case, i needed to install extra packages like apr,apr-util,pcre2 and had to do some extra configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment