Como compilar a última versão do PHP no Debian 7

por Pedro Resende em 03/03/2014 às 14:13:00

php

Vamos começar por ir buscar as dependências necessárias para a compilação do php, para isso é necessário correrem

 apt-get build-dep php5

Necessitamos agora da última versão do php que poderá ser descarregada do php.net

 wget http://pt1.php.net/get/php-5.5.9.tar.gz/from/this/mirror

Vamos descomprimir, utilizando

 tar -xzf php-5.5.9.tar.gz

Entramos para dentro do directório

 cd php-5.5.9

Vamos então correr a configuração

 ./configure \
--with-config-file-path=/etc/php5/apache2 \
--disable-rpath \
--enable-bcmath \
--enable-calendar \
--enable-cgi \
--enable-dba \
--enable-exif \
--enable-ftp \
--enable-gd-native-ttf \
--enable-inline-optimization \
--enable-intl \
--enable-mbregex \
--enable-mbstring \
--enable-pcntl \
--enable-shmop \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--enable-zip \
--with-apxs2=/usr/bin/apxs2 \
--with-bz2 \
--with-curl \
--with-curlwrappers \
--with-freetype-dir \
--with-gd \
--with-gettext \
--with-jpeg-dir=/usr \
--with-kerberos \
--with-libdir=lib64 \
--with-libxml-dir=/usr \
--with-mcrypt \
--with-mhash \
--with-mysql \
--with-mysqli \
--with-openssl \
--with-pcre-regex \
--with-pdo-mysql \
--with-pear \
--with-png-dir=/usr \
--with-pspell \
--with-xsl \
--with-xmlrpc \
--with-zlib \
--with-zlib \
--with-zlib-dir

E compilamos com

 make

Instalamos com

 make install

E verificamos que está bem instalado correndo


PHP 5.5.9 (cli) (built: Mar  3 2014 11:51:59)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
Pedro Resende

Pedro Resende

With over two decades of experience as a Full Stack Developer, I have journeyed through diverse facets of software development. Commencing with the creation of compact institutional websites, I progressed to crafting portals for insurance brokers and contributed to substantial projects for renowned companies such as MS Amlin. My expertise expanded further by delving into product development for Advertiser Kwanko and collaborating with startups in their pivotal ramp-up stages. Notably, I've been involved in architecting extensive e-commerce solutions for global enterprises like Wayfair.

I currently serve as the Tech Lead at Emergn, contributing to the establishment and advancement of the Strategyzer client.