| #!/bin/bash | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root" 1>&2 | |
| exit 1 | |
| fi | |
| apt-get update | |
| apt-get install -y git-core autoconf bison libxml2-dev libbz2-dev libmcrypt-dev libcurl4-openssl-dev libltdl-dev libpng-dev libpspell-dev libreadline-dev make | |
| mkdir -p /etc/php7/conf.d | |
| mkdir -p /etc/php7/cli/conf.d | |
| mkdir /usr/local/php7 | |
| cd /tmp | |
| git clone https://github.com/php/php-src.git --depth=1 | |
| cd php-src | |
| ./buildconf | |
| ./configure --prefix=/usr/local/php7 --enable-bcmath --with-bz2 --enable-calendar --enable-exif --enable-dba --enable-ftp --with-gettext --with-gd --enable-mbstring --with-mcrypt --with-mhash --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --enable-pcntl --with-pspell --enable-shmop --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --with-zlib --enable-zip --with-readline --with-curl --with-config-file-path=/etc/php7/cli --with-config-file-scan-dir=/etc/php7/cli/conf.d | |
| make | |
| make test | |
| make install |
|
thanks, I've changed it |
ghost
commented
Jul 11, 2015
|
Works like a charm on Ubuntu 14.04, thanks! |
zvook
commented
Jul 21, 2015
|
Many thanks! |
bravo-kernel
commented
Sep 6, 2015
|
On a fresh Ubuntu 15.04 I had to install the following additional packages:
|
KiberMath
commented
Sep 12, 2015
|
How to make apache2 use php7 as module? |
wdjwxh
commented
Sep 29, 2015
|
noneed to add --with-mysql php7 doesn't have mysql |
ctrl-f5
commented
Oct 21, 2015
|
if you want to install different versions by checking out another branch, using the same directory for php-src, add force to buildconf:
|
boynet
commented
Nov 8, 2015
|
is it normal that make test return "You may have found a problem in PHP."?
|
l-x
commented
Nov 10, 2015
|
Great work, thanks alot! Maybe you might change line 12 to make -j `nproc`to make use of all cores when compiling. |
carithma
commented
Nov 13, 2015
|
error in ubuntu 15.04
do
|
TMDroid
commented
Dec 3, 2015
|
I get this error during Installing PEAR environment: /usr/local/php7/lib/php/
--2015-12-03 11:24:08-- https://pear.php.net/install-pear-nozlib.phar
Resolving pear.php.net (pear.php.net)... 5.35.241.22
Connecting to pear.php.net (pear.php.net)|5.35.241.22|:443... connected.
ERROR: no certificate subject alternative name matches
requested host name ‘pear.php.net’.
To connect to pear.php.net insecurely, use `--no-check-certificate'.
make: *** [install-pear] Error 5How can I fix it? I can't just EDIT: |
Faryshta
commented
Dec 4, 2015
|
@csanonymus at which is the full pat of the pear/ folde your mention? did you changed the filename? |
ersin-demirtas
commented
Dec 4, 2015
|
@Faryshta I am guessing, he is talking about the Makefile in php-src folder. The pear server has problem, they replaced with a new machine and the SSL certificates don't match which means you will have to use http protocol instead. It worked for me :D. Just find https://pear.php.net/install-pear-nozlib.phar and replace with http://pear.php.net/install-pear-nozlib.phar |
LubosRemplik
commented
Dec 4, 2015
|
@csanonymus The server running pear.php.net had a fatal hard disk failure and gets replaced by a new machine this week. Until the new machine is setup, this page is up to let you continue installing PEAR packages via the PEAR installer. |
adrianmak
commented
Dec 4, 2015
|
no compile with apache module support ? |
jacobschweitzer
commented
Dec 4, 2015
|
Ran all the commands, had to change the pear address from https to http in /tmp/php-src/makefile before running make install. But how do I connect with it using nginx, for example? I tried this: but didn't work. I tried php.sock and php7-fpm.sock and those didn't work either. Am I missing something here? After this I tried the instructions here - https://bjornjohansen.no/upgrade-to-php7 So...great PHP7 is out but I can't install it... |
k0pernikus
commented
Dec 4, 2015
|
The gist is failing for me on Ubuntu14.04:
|
fabianhenzler
commented
Dec 4, 2015
|
@csanonymus @LubosRemplik @ersin-demirtas where shall I replace http://pear.php.net/install-pear-nozlib.phar ? I'm confused :( |
Faryshta
commented
Dec 4, 2015
|
@fabianhenzler open the /tmp/php-src/Makefile with any text editor and seek https://pear.php.net/install-pear-nozlib.phar edit it and run make install again |
Geekbell
commented
Dec 4, 2015
|
Mine works successfully, it seems, but it's almost as if php is not running. Anyone have a similar experience? Are there any prerequisites? |
jacobschweitzer
commented
Dec 4, 2015
|
@Geekbell Yeah I've tried all kinds of different things and can't get this working. |
Geekbell
commented
Dec 4, 2015
|
I actually got it to work after reboot php -v: php info in web browser still shows 5.6. The other weird part is that I get raw php in browser until I refresh each page. |
aisthetes
commented
Dec 5, 2015
|
add --with-apxs2 to ./configure for create /usr/lib/apache2/modules/libphp7.so work on ubuntu 15.10 :) PHP 7.1.0-dev (cli) (built: Dec 5 2015 12:40:12) ( NTS ) |
joshuataylor
commented
Dec 5, 2015
|
Looks like the pear server is having dramas:
So you will have thep atch your files, as above. Also make sure you're on 7.0.0 if you want extensions etc to work properly :). If you are lazy:
|
Geekbell
commented
Dec 5, 2015
|
@aisthetes I started over on 15.10 to see if I could get it to work. Still a no go. does php5 have to be installed for it to work? |
aisthetes
commented
Dec 5, 2015
|
@Geekbell |
enoch85
commented
Dec 6, 2015
|
Will this install the stable version of PHP7? I see alot of dev packages... Anyone tested on Ubuntu Server 14.04.3? |
roman204
commented
Dec 6, 2015
|
http://pear.php.net/install-pear-nozlib.phar is throwing a 404 error ?!? |
aisthetes
commented
Dec 6, 2015
|
work on Raspbian GNU/Linux 8.0 (jessie), but slower than PHP Version 5.6.14-0+deb8u1 |
jacobschweitzer
commented
Dec 7, 2015
|
So this is what ended up working for me on Ubuntu 14.04 with Nginx: Then edit your Nginx config file: Then restart Nginx: |
akeinhell
commented
Dec 9, 2015
|
Add check for root-prvilege
|
Shaeldon
commented
Dec 10, 2015
|
How can i compile it withj mssql drivers/dblib? --with-mssql doesnt work? |
ram-you
commented
Dec 10, 2015
|
For Apache2, add to @jacobschweitzer method : |
andrewtweber
commented
Dec 13, 2015
|
Thanks @ram-you |
oppachoriya
commented
Dec 15, 2015
|
Script is falling for me TIME END 2015-12-15 13:58:47 TEST RESULT SUMMARYExts skipped : 22 Exts tested : 53Number of tests : 14319 11560 Tests passed : 11513 ( 80.4%) ( 99.6%)Time taken : 409 secondsEXPECTED FAILED TEST SUMMARYTest open_basedir configuration [tests/security/open_basedir_linkinfo.phpt] XFAIL REASON: BUG: open_basedir cannot delete symlink to prohibited file. See also Bug #70470 (Built-in server truncates headers spanning over TCP packets) [sapi/cli/tests/bug70470.phpt] XFAIL REASON: bug is not fixed yetFAILED TEST SUMMARYBug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction) [ext/curl/tests/bug61948.phpt] Test glob() function: ensure no platform difference, variation 3 [ext/standard/tests/file/glob_variation5.phpt]WARNED TEST SUMMARYLive range & throw from finally [Zend/tests/temporary_cleaning_010.phpt](warn: XFAIL section but test passes) Bug #70219 Use after free vulnerability in session deserializer [ext/standard/tests/serialize/bug70219.phpt](warn: XFAIL section but test passes)You may have found a problem in PHP. |
hvanmegen
commented
Dec 16, 2015
|
Please add root-permission check like @akeinhell stated 7 days ago:
Also, add the 'make' package to 'apt-get install' list of packages; I just installed a fresh 14.04 server, and that package was missing :) |
|
thanks @akeinhell, I've added it |
|
thanks @hvanmegen, I've added the make to 'apt-get install'. |
akeinhell commentedApr 2, 2015
git clone https://github.com/php/php-src.git --depth=1