#!/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 |
This comment has been minimized.
This comment has been minimized.
thanks, I've changed it |
This comment has been minimized.
This comment has been minimized.
Works like a charm on Ubuntu 14.04, thanks! |
This comment has been minimized.
This comment has been minimized.
Many thanks! |
This comment has been minimized.
This comment has been minimized.
On a fresh Ubuntu 15.04 I had to install the following additional packages:
|
This comment has been minimized.
This comment has been minimized.
How to make apache2 use php7 as module? |
This comment has been minimized.
This comment has been minimized.
noneed to add --with-mysql php7 doesn't have mysql |
This comment has been minimized.
This comment has been minimized.
if you want to install different versions by checking out another branch, using the same directory for php-src, add force to buildconf:
|
This comment has been minimized.
This comment has been minimized.
is it normal that make test return "You may have found a problem in PHP."?
|
This comment has been minimized.
This comment has been minimized.
Great work, thanks alot! Maybe you might change line 12 to make -j `nproc` to make use of all cores when compiling. |
This comment has been minimized.
This comment has been minimized.
error in ubuntu 15.04
do
|
This comment has been minimized.
This comment has been minimized.
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 5 How can I fix it? I can't just EDIT: |
This comment has been minimized.
This comment has been minimized.
@csanonymus at which is the full pat of the pear/ folde your mention? did you changed the filename? |
This comment has been minimized.
This comment has been minimized.
@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 |
This comment has been minimized.
This comment has been minimized.
@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. |
This comment has been minimized.
This comment has been minimized.
no compile with apache module support ? |
This comment has been minimized.
This comment has been minimized.
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... |
This comment has been minimized.
This comment has been minimized.
The gist is failing for me on Ubuntu14.04:
|
This comment has been minimized.
This comment has been minimized.
@csanonymus @LubosRemplik @ersin-demirtas where shall I replace http://pear.php.net/install-pear-nozlib.phar ? I'm confused :( |
This comment has been minimized.
This comment has been minimized.
@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 |
This comment has been minimized.
This comment has been minimized.
Mine works successfully, it seems, but it's almost as if php is not running. Anyone have a similar experience? Are there any prerequisites? |
This comment has been minimized.
This comment has been minimized.
@Geekbell Yeah I've tried all kinds of different things and can't get this working. |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
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 ) |
This comment has been minimized.
This comment has been minimized.
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:
|
This comment has been minimized.
This comment has been minimized.
@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? |
This comment has been minimized.
This comment has been minimized.
@Geekbell |
This comment has been minimized.
This comment has been minimized.
Will this install the stable version of PHP7? I see alot of dev packages... Anyone tested on Ubuntu Server 14.04.3? |
This comment has been minimized.
This comment has been minimized.
http://pear.php.net/install-pear-nozlib.phar is throwing a 404 error ?!? |
This comment has been minimized.
This comment has been minimized.
work on Raspbian GNU/Linux 8.0 (jessie), but slower than PHP Version 5.6.14-0+deb8u1 |
This comment has been minimized.
This comment has been minimized.
So this is what ended up working for me on Ubuntu 14.04 with Nginx: Then edit your Nginx config file: Then restart Nginx: |
This comment has been minimized.
This comment has been minimized.
Add check for root-prvilege
|
This comment has been minimized.
This comment has been minimized.
How can i compile it withj mssql drivers/dblib? --with-mssql doesnt work? |
This comment has been minimized.
This comment has been minimized.
For Apache2, add to @jacobschweitzer method : |
This comment has been minimized.
This comment has been minimized.
Thanks @ram-you |
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
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 :) |
This comment has been minimized.
This comment has been minimized.
thanks @akeinhell, I've added it |
This comment has been minimized.
This comment has been minimized.
thanks @hvanmegen, I've added the make to 'apt-get install'. |
This comment has been minimized.
git clone https://github.com/php/php-src.git --depth=1