-
-
Save tronsha/b471dd6d73dc8ebae242 to your computer and use it in GitHub Desktop.
#!/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 |
error in ubuntu 15.04
configure: error: Cannot find OpenSSL's libraries
do
apt-get install pkg-config
I get this error during make install
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 make install --no-check-certificate
because it's not a recognized option
EDIT:
I managed to install it by using this link to get pear pear.php.net/go-pear.phar
and manually moved it to pear/
and then the installation went smooth although there was a problem with getting https://pear.php.net/install-pear-nozlib.phar
.. There's a 404
so if anyone has this problem just use pear.php.net/go-pear.phar
@csanonymus at which is the full pat of the pear/ folde your mention? did you changed the filename?
@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
@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.
no compile with apache module support ?
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:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
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
but that has dependency issues when installing so it didn't work either.
So...great PHP7 is out but I can't install it...
The gist is failing for me on Ubuntu14.04:
PASS Multipart Form POST Data, incorrect content length [sapi/tests/test007.phpt]
=====================================================================
TIME END 2015-12-04 18:15:49
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 22
Exts tested : 53
---------------------------------------------------------------------
Number of tests : 14289 11536
Tests skipped : 2753 ( 19.3%) --------
Tests warned : 3 ( 0.0%) ( 0.0%)
Tests failed : 6 ( 0.0%) ( 0.1%)
Expected fail : 36 ( 0.3%) ( 0.3%)
Tests passed : 11491 ( 80.4%) ( 99.6%)
---------------------------------------------------------------------
Time taken : 590 seconds
=====================================================================
=====================================================================
EXPECTED FAILED TEST SUMMARY
---------------------------------------------------------------------
Test open_basedir configuration [tests/security/open_basedir_linkinfo.phpt] XFAIL REASON: BUG: open_basedir cannot delete symlink to prohibited file. See also
bugs 48111 and 52176.
Inconsistencies when accessing protected members [Zend/tests/access_modifiers_008.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Inconsistencies when accessing protected members - 2 [Zend/tests/access_modifiers_009.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_2.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_3.phpt] XFAIL REASON: See Bug #48770
Initial value of static var in method depends on the include time of the class definition [Zend/tests/method_static_var.phpt] XFAIL REASON: Maybe not a bug
Bug #70228 (memleak if return in finally block) [Zend/tests/try/bug70228.phpt] XFAIL REASON: See https://bugs.php.net/bug.php?id=70228
DateTime::add() -- fall type2 type3 [ext/date/tests/DateTime_add-fall-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- fall type3 type2 [ext/date/tests/DateTime_add-fall-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- fall type3 type3 [ext/date/tests/DateTime_add-fall-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- spring type2 type3 [ext/date/tests/DateTime_add-spring-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- spring type3 type2 [ext/date/tests/DateTime_add-spring-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- spring type3 type3 [ext/date/tests/DateTime_add-spring-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type2 type3 [ext/date/tests/DateTime_diff-fall-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type3 type2 [ext/date/tests/DateTime_diff-fall-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type3 type3 [ext/date/tests/DateTime_diff-fall-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type2 type3 [ext/date/tests/DateTime_diff-spring-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type3 type2 [ext/date/tests/DateTime_diff-spring-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type3 type3 [ext/date/tests/DateTime_diff-spring-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type2 type3 [ext/date/tests/DateTime_sub-fall-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type3 type2 [ext/date/tests/DateTime_sub-fall-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type3 type3 [ext/date/tests/DateTime_sub-fall-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type2 type3 [ext/date/tests/DateTime_sub-spring-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type3 type2 [ext/date/tests/DateTime_sub-spring-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type3 type3 [ext/date/tests/DateTime_sub-spring-type3-type3.phpt] XFAIL REASON: Various bugs exist
Bug #55407 (Impossible to prototype DateTime::createFromFormat) [ext/date/tests/bug55407.phpt] XFAIL REASON: Bug #55407
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2) [ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt] XFAIL REASON: Still not quite right
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs) [ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt] XFAIL REASON: Still not quite right
Bug #42718 (unsafe_raw filter not applied when configured as default filter) [ext/filter/tests/bug42718.phpt] XFAIL REASON: FILTER_UNSAFE_RAW not applied when configured as default filter, even with flags
Bug #67296 (filter_input doesn't validate variables) [ext/filter/tests/bug49184.phpt] XFAIL REASON: See Bug #49184
Bug #67167: filter_var(null,FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE) returns null [ext/filter/tests/bug67167.02.phpt] XFAIL REASON: Requires php_zval_filter to not use convert_to_string for all filters.
Bug #53640 (XBM images require width to be multiple of 8) [ext/gd/tests/bug53640.phpt] XFAIL REASON: Padding is not implemented yet
Phar: bug #69958: Segfault in Phar::convertToData on invalid file [ext/phar/tests/bug69958.phpt] XFAIL REASON: Still has memory leaks, see https://bugs.php.net/bug.php?id=70005
Test basic function : variation3 use_trans_sid [ext/session/tests/session_basic3.phpt] XFAIL REASON: Waiting url_scanner_ex.re fix. https://bugs.php.net/bug.php?id=68970
Bug #70470 (Built-in server truncates headers spanning over TCP packets) [sapi/cli/tests/bug70470.phpt] XFAIL REASON: bug is not fixed yet
=====================================================================
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Concatenating many small strings should not slowdown allocations [Zend/tests/concat_003.phpt]
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction) [ext/curl/tests/bug61948.phpt]
Bug # #68937 (Segfault in curl_multi_exec) [ext/curl/tests/bug68937.phpt]
Bug # #68937 (Segfault in curl_multi_exec) [ext/curl/tests/bug68937_2.phpt]
Bug #41655 (open_basedir bypass via glob()) 1/2 [ext/standard/tests/file/bug41655_1.phpt]
Test glob() function: ensure no platform difference, variation 3 [ext/standard/tests/file/glob_variation5.phpt]
=====================================================================
=====================================================================
WARNED TEST SUMMARY
---------------------------------------------------------------------
Live range & throw from finally [Zend/tests/temporary_cleaning_010.phpt] (warn: XFAIL section but test passes)
Bug #70172 - Use After Free Vulnerability in unserialize() [ext/standard/tests/serialize/bug70172_2.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 report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to [email protected] later.
Do you want to send this report now? [Yns]: Y
@csanonymus @LubosRemplik @ersin-demirtas where shall I replace http://pear.php.net/install-pear-nozlib.phar ? I'm confused :(
@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
Mine works successfully, it seems, but it's almost as if php is not running. Anyone have a similar experience? Are there any prerequisites?
@Geekbell Yeah I've tried all kinds of different things and can't get this working.
I actually got it to work after reboot php -v:
PHP 7.1.0-dev (cli) (built: Dec 4 2015 18:40:47) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2015 Zend Technologies
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.
add --with-apxs2 to ./configure for create /usr/lib/apache2/modules/libphp7.so
and sudo cp /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php7.conf
work on ubuntu 15.10 :)
PHP 7.1.0-dev (cli) (built: Dec 5 2015 12:40:12) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2015 Zend Technologies
Looks like the pear server is having dramas:
Intermediate pear.php.net server
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.
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:
sed -i 's/https:\/\/pear.php.net\/install-pear-nozlib.phar/http:\/\/pear.php.net\/install-pear-nozlib.phar/g' /tmp/php-src/Makefile
@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?
@Geekbell
$ sudo a2dismod php5
$ sudo cp /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php7.conf
$ sudo service apache2 restart
Will this install the stable version of PHP7? I see alot of dev packages...
Anyone tested on Ubuntu Server 14.04.3?
http://pear.php.net/install-pear-nozlib.phar is throwing a 404 error ?!?
anyone got it working ?
work on Raspbian GNU/Linux 8.0 (jessie), but slower than PHP Version 5.6.14-0+deb8u1
So this is what ended up working for me on Ubuntu 14.04 with Nginx:
sudo service nginx stop
sudo apt-get purge php5-*
sudo add-apt-repository ppa:ondrej/php-7.0
sudo apt-get update
sudo apt-get install php7.0 php7.0-common php7.0-cgi php7.0-fpm php7.0-mysql
Then edit your Nginx config file:
sudo nano /etc/nginx/sites-available/thedomainnamegoeshere.com
location ~ .php$ {
include fastcgi_params;
fastcgi_keep_conn on;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
Then restart Nginx:
sudo service nginx start
Add check for root-prvilege
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
How can i compile it withj mssql drivers/dblib? --with-mssql doesnt work?
For Apache2, add to @jacobschweitzer method :
sudo apt-get install libapache2-mod-php7.0
Thanks @ram-you
Script is falling for me
TIME END 2015-12-15 13:58:47
TEST RESULT SUMMARY
Exts skipped : 22
Exts tested : 53
Number of tests : 14319 11560
Tests skipped : 2759 ( 19.3%) --------
Tests warned : 3 ( 0.0%) ( 0.0%)
Tests failed : 8 ( 0.1%) ( 0.1%)
Expected fail : 36 ( 0.3%) ( 0.3%)
Tests passed : 11513 ( 80.4%) ( 99.6%)
Time taken : 409 seconds
EXPECTED FAILED TEST SUMMARY
Test open_basedir configuration [tests/security/open_basedir_linkinfo.phpt] XFAIL REASON: BUG: open_basedir cannot delete symlink to prohibited file. See also
bugs 48111 and 52176.
Inconsistencies when accessing protected members [Zend/tests/access_modifiers_008.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Inconsistencies when accessing protected members - 2 [Zend/tests/access_modifiers_009.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_2.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_3.phpt] XFAIL REASON: See Bug #48770
Initial value of static var in method depends on the include time of the class definition [Zend/tests/method_static_var.phpt] XFAIL REASON: Maybe not a bug
Bug #70228 (memleak if return in finally block) [Zend/tests/try/bug70228.phpt] XFAIL REASON: See https://bugs.php.net/bug.php?id=70228
DateTime::add() -- fall type2 type3 [ext/date/tests/DateTime_add-fall-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- fall type3 type2 [ext/date/tests/DateTime_add-fall-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- fall type3 type3 [ext/date/tests/DateTime_add-fall-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- spring type2 type3 [ext/date/tests/DateTime_add-spring-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- spring type3 type2 [ext/date/tests/DateTime_add-spring-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::add() -- spring type3 type3 [ext/date/tests/DateTime_add-spring-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type2 type3 [ext/date/tests/DateTime_diff-fall-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type3 type2 [ext/date/tests/DateTime_diff-fall-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- fall type3 type3 [ext/date/tests/DateTime_diff-fall-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type2 type3 [ext/date/tests/DateTime_diff-spring-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type3 type2 [ext/date/tests/DateTime_diff-spring-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::diff() -- spring type3 type3 [ext/date/tests/DateTime_diff-spring-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type2 type3 [ext/date/tests/DateTime_sub-fall-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type3 type2 [ext/date/tests/DateTime_sub-fall-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- fall type3 type3 [ext/date/tests/DateTime_sub-fall-type3-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type2 type3 [ext/date/tests/DateTime_sub-spring-type2-type3.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type3 type2 [ext/date/tests/DateTime_sub-spring-type3-type2.phpt] XFAIL REASON: Various bugs exist
DateTime::sub() -- spring type3 type3 [ext/date/tests/DateTime_sub-spring-type3-type3.phpt] XFAIL REASON: Various bugs exist
Bug #55407 (Impossible to prototype DateTime::createFromFormat) [ext/date/tests/bug55407.phpt] XFAIL REASON: Bug #55407
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, bd2) [ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-bd2.phpt] XFAIL REASON: Still not quite right
RFC: DateTime and Daylight Saving Time Transitions (zone type 3, fs) [ext/date/tests/rfc-datetime_and_daylight_saving_time-type3-fs.phpt] XFAIL REASON: Still not quite right
Bug #42718 (unsafe_raw filter not applied when configured as default filter) [ext/filter/tests/bug42718.phpt] XFAIL REASON: FILTER_UNSAFE_RAW not applied when configured as default filter, even with flags
Bug #67296 (filter_input doesn't validate variables) [ext/filter/tests/bug49184.phpt] XFAIL REASON: See Bug #49184
Bug #67167: filter_var(null,FILTER_VALIDATE_BOOLEAN,FILTER_NULL_ON_FAILURE) returns null [ext/filter/tests/bug67167.02.phpt] XFAIL REASON: Requires php_zval_filter to not use convert_to_string for all filters.
Bug #53640 (XBM images require width to be multiple of 8) [ext/gd/tests/bug53640.phpt] XFAIL REASON: Padding is not implemented yet
Phar: bug #69958: Segfault in Phar::convertToData on invalid file [ext/phar/tests/bug69958.phpt] XFAIL REASON: Still has memory leaks, see https://bugs.php.net/bug.php?id=70005
Test basic function : variation3 use_trans_sid [ext/session/tests/session_basic3.phpt] XFAIL REASON: Waiting url_scanner_ex.re fix. https://bugs.php.net/bug.php?id=68970
Bug #70470 (Built-in server truncates headers spanning over TCP packets) [sapi/cli/tests/bug70470.phpt] XFAIL REASON: bug is not fixed yet
FAILED TEST SUMMARY
Bug #61948 (CURLOPT_COOKIEFILE '' raises open_basedir restriction) [ext/curl/tests/bug61948.phpt]
Bug # #68937 (Segfault in curl_multi_exec) [ext/curl/tests/bug68937.phpt]
Bug # #68937 (Segfault in curl_multi_exec) [ext/curl/tests/bug68937_2.phpt]
Bug #32330 (session_destroy, "Failed to initialize storage module", custom session handler) [ext/session/tests/bug32330.phpt]
Test session_set_save_handler() function : variation [ext/session/tests/session_set_save_handler_variation4.phpt]
Test session_set_save_handler() function : variation [ext/session/tests/session_set_save_handler_variation5.phpt]
Bug #41655 (open_basedir bypass via glob()) 1/2 [ext/standard/tests/file/bug41655_1.phpt]
Test glob() function: ensure no platform difference, variation 3 [ext/standard/tests/file/glob_variation5.phpt]
WARNED TEST SUMMARY
Live range & throw from finally [Zend/tests/temporary_cleaning_010.phpt](warn: XFAIL section but test passes)
Bug #70172 - Use After Free Vulnerability in unserialize() [ext/standard/tests/serialize/bug70172_2.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 report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it. You can then email it to [email protected] later.
Do you want to send this report now? [Yns]:
Please add root-permission check like @akeinhell stated 7 days ago:
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
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'.
Great work, thanks alot! Maybe you might change line 12 to
make -j `nproc`
to make use of all cores when compiling.