Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95560 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 12207 invoked from network); 2 Sep 2016 12:28:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2016 12:28:47 -0000 Authentication-Results: pb1.pair.com header.from=coladict@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=coladict@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.182 as permitted sender) X-PHP-List-Original-Sender: coladict@gmail.com X-Host-Fingerprint: 209.85.213.182 mail-yb0-f182.google.com Received: from [209.85.213.182] ([209.85.213.182:35117] helo=mail-yb0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 02/E4-19490-E7079C75 for ; Fri, 02 Sep 2016 08:28:46 -0400 Received: by mail-yb0-f182.google.com with SMTP id h3so38661545ybi.2 for ; Fri, 02 Sep 2016 05:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=ddYXxu512ScrWHeu2AW4R1oL8eh+yiZp4A0aH0geCQQ=; b=ptgyKobvVsfNFNe2shlaXFk/mI7SqFNBpKaDRGL7uWdgqq2ocLDhKd+9ADU+Xf7QoW 5s7LHOgiuYT1vX4eU0doQ4Ow3WbnpOpDqH1LBcDQmsDUASAI8A5fWSQvBZPlFfuAv70Q xT+PCWy8sNsh5NMuKHW0LnFsd0B7d8sI8eKyLhCdHHEtkV16sfTTwT/ivD70Gvw9Dc/V 24f9i24jWUvDOu6vNQnRShRNgkc6ri44rBOt0BsUVENafPXWRHtG2LWPlaHh8Yk1wt9I dXvzWCEzvofNbWyGhZvJCNGJzrIKfqXx3zmDZwKFocG8NJ2lTRvRw9LXaFnfUME5NJqe ji9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ddYXxu512ScrWHeu2AW4R1oL8eh+yiZp4A0aH0geCQQ=; b=gNfnT5z5JYZAJch8z4KSQunEPcvJDa+eCUPMkQtGT048vWNEvofhDIm38tTkX5PwX+ rI5Z8bn5MRlAuTlPYU5/J7c7BC16XB2MHrQRzViqyISA4X3HLBikqQqMnyRHhIXanxiU KVc9z+IPX5rdCYSu8jtbo5RNO5EcMlqmC5sDmKgSZbv9Y/mem6SDT+Yp0qvZRIOi4W8c BCgk2CWqi9gonoIlE+I172Cjyd050pPZ67cwGnMO+t+6xjspVivK2mH7BqGKGKadtmtw Tabro6TyknvWkgYQAk2XtcmmLyzHtXIxU9qT4AFYrm/yg0tGwB272ra2J0OYXX6xFKH5 /Gog== X-Gm-Message-State: AE9vXwMqcKF6UnR+uxgvuwIG49UU1bKhK8aTJsJ2EWKq2p7Ow4jQHNC7I//mn4fZJDdu71a7ovSR8jlejHw3/A== X-Received: by 10.37.205.67 with SMTP id d64mr17130813ybf.177.1472819323783; Fri, 02 Sep 2016 05:28:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.83.20.135 with HTTP; Fri, 2 Sep 2016 05:28:23 -0700 (PDT) Date: Fri, 2 Sep 2016 15:28:23 +0300 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=94eb2c18a6f29cd066053b857808 Subject: Non-conflicting PHP 5 and 7 builds From: coladict@gmail.com (Jordan Gigov) --94eb2c18a6f29cd066053b857808 Content-Type: text/plain; charset=UTF-8 Most developers who hope to move a site to PHP 7 will still have to maintain PHP 5 sites for a long time, requiring the presence of both. However, building either one, even with the `--program-suffix` configuration option still overwrites some files, like phpize and all the headers in ${prefix}/includes/. It took me a week to solve this problem for myself and everyone else in our company, but I have proper working patches for it now. They have not been submitted as pull requests yet, because I first want to hear what you think of them. Here are the links: https://github.com/coladict/php-src/tree/php5-migration https://github.com/coladict/php-src/tree/php7-migration These change the install destinations like so: ${prefix}/bin/php => ${prefix}/bin/php[5 or 7] ${prefix}/bin/phpize => ${prefix}/bin/php[5 or 7]ize ${prefix}/bin/php-config => ${prefix}/bin/php[5 or 7]-config ${prefix}/bin/php-cgi => ${prefix}/bin/php[5 or 7]-cgi ${prefix}/bin/phpdbg => ${prefix}/bin/php[5 or 7]dbg ${prefix}/bin/phar => ${prefix}/bin/phar[5 or 7] ${prefix}/bin/phar.phar => ${prefix}/bin/phar[5 or 7].phar I have also added a "install-alternatives" make target that creates soft links to the legacy locations. In systems that have "update-alternatives" like Debian, Ubuntu or Fedora it uses it to generate the links, otherwise it falls-back to "ln -s". In addition these both contain fixes for gd, gmp and ldap extensions that fail to build under Ubuntu 16.04. Tested under Docker containers of ubuntu:xenial, fedora and dock0/arch (Archlinux). Additional configure options used when testing: --with-pic --enable-cli --enable-phpdbg --disable-fpm --with-apxs2=no --build=x86_64-linux-gnu --with-layout=GNU I don't know why automatic detection always yields x86_64-unknown-linux-gnu for build under Ubuntu, but that's not particular to PHP. Shared extensions that are also built and loaded without error during the testing: mbstring gd mysqlnd mysqli pdo_mysql curl gettext pgsql pdo_pgsql xmlrpc bz2 xsl enchant interbase pdo_firebird mcrypt pspell gmp ldap readline recode tidy Making separately building mysqlnd work as shared should really come with it's own instructions. I had to use this complicated stuff ./configure --build=x86_64-linux-gnu --with-pic --enable-mysqlnd \ CFLAGS="-I/usr/include/openssl -I$(dirname $(dirname $(pwd))) -DCOMPILE_DL_MYSQLND -DMYSQLND_SSL_SUPPORTED -DMYSQLND_COMPRESSION_WANTED -DMYSQLND_COMPRESSION_ENABLED -DMYSQLND_HAVE_SSL" \ PHP_OPENSSL="/usr/local /usr" --with-libdir=lib/x86_64-linux-gnu Under Fedora that libdir option changes to --with-libdir=lib64 --94eb2c18a6f29cd066053b857808--