Giter Site home page Giter Site logo

PHP7 Support about php HOT 25 CLOSED

sous-chefs avatar sous-chefs commented on May 14, 2024 5
PHP7 Support

from php.

Comments (25)

sergiuionescu avatar sergiuionescu commented on May 14, 2024 4

The cookbook can currently be used to install php7 using custom package repositories and a minor patch.
Here is how i manage to set it up for ubuntu 14.04:

In your custom recipe setup the ppa before including the php cookbook:

apt_repository 'ondrej-php' do
  uri          'ppa:ondrej/php'
  distribution node['lsb']['codename']
  only_if { node['php']['version'] >= '7' }
end
...
include_recipe 'php'
  1. Override the following default attributes:
"override_attributes": {
        "php": {
            "version": "7.0",
            "conf_dir": "/etc/php/7.0/cli",
            "packages": [
                "php7.0-cgi",
                "php7.0",
                "php7.0-dev",
                "php7.0-cli",
                "php7.0-json",
                "php7.0-curl",
                "php-pear"
            ],
            "mysql": {
                "package": "php7.0-mysql"
            },
            "fpm_package": "php7.0-fpm",
            "fpm_pooldir": "/etc/php/7.0/fpm/pool.d",
            "fpm_service": "php7.0-fpm",
            "fpm_default_conf": "/etc/php/7.0/fpm/pool.d/www.conf"
        }
    }

If you wish to give it a spin, you can find the full setup here:
https://github.com/sergiuionescu/lamp

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024 2

I would be open to adjusting the commits or splitting it into multiple PRs while we wait for official boxes. I have no desire to maintain my own fork of the PHP cookbook so I'd like to get some of these changes merged back if they feel it's a fit for the cookbook.

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024 1

Any movement on this? We're working to get our environments prepared for Ubuntu 16.04 and PHP7 support is a step in the process.

from php.

danbuchal avatar danbuchal commented on May 14, 2024 1

@tas50 is there any possibility of parameterizing just the enable_mod and disable_mod that @ThatGerber submitted? With that change alone I was able to install PHP7 by overriding the other parameters as needed. This would not need to install PHP7 by default or even "officially" claim support of PHP7, but would allow those adventurous enough to be able to do it.

from php.

tas50 avatar tas50 commented on May 14, 2024 1

Ubuntu 16.04 boxes are out so we can test this and get it out. I've added 16.04 testing to this repo, which is why it's currently failing. I'll see what I can do tomorrow.

from php.

matthieumota avatar matthieumota commented on May 14, 2024

I think you can easily use PHP7 with override attributes and packages but beware if you use fpm. There are many attributes to this to change and maybe the provider need to be update. I wish PHP7 from this cookbook too πŸ‘

from php.

sebfek avatar sebfek commented on May 14, 2024

+1 :)

from php.

thomask avatar thomask commented on May 14, 2024

πŸ‘

from php.

tas50 avatar tas50 commented on May 14, 2024

At the moment there isn't work being done to prep for PHP7. Why you might ask? Well we're a fairly small team working on a several year backlog of work. At the moment we're doing work on the Tomcat, etcd, and docker cookbooks. I personally expect to be hitting PHP soon and I plan to evaluate a large scale refactor that would do away with the mess of attributes we have right now and would also include support for additional PHP versions.

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024

Thanks @tas50 for the update. I hope I didn't come off demanding with my question, I just didn't want to get started on a PR for php7 support and find out some work had already been started on another branch.

from php.

jekriske-lilly avatar jekriske-lilly commented on May 14, 2024

πŸ‘ to PHP7, it's significantly faster. Looking forward to the refactor.

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024

I'm more referring to the LWRP.

php_pear "XML_RPC" do
  version "1.5.4"
  action :install
end

Will run /usr/sbin/php5enmod XML_RPC instead of phpenmod XML_RPC, adding it as a php5 module instead of php7. A problem that can be easily solved when I have time to create the pull request, but also other cases like that might need to be taken into account.

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024

#169

I've created a PR that will bring support for Ubuntu 16.04 (which will default to PHP7) and allow for PHP7 to be supported on Ubuntu 14.04, as well.

from php.

aight8 avatar aight8 commented on May 14, 2024

Is there any status update for the PR?

from php.

tas50 avatar tas50 commented on May 14, 2024

PHP7 support is going to require us to start testing on 16.04, and we currently lack GM docker boxes for Travis CI testing and GM bento boxes for testing locally. Once the final 16.04 release comes out and we have a testing infrastructure in place we'll move forward with PHP7 support.

from php.

ameir avatar ameir commented on May 14, 2024

I think that modularizing the FPM portions a bit would make supporting PHP7 or alternate repos much easier. Instead of the php-fpm install being taken care of in the provider, I think it'd be better to just do include_recipe 'php::fpm' if users want the default package, else they can install from remi or a ppa or whatever, and use the LWRP to manage the FPM pools.

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024

@tas50 I written fixes for the PR that I will push once sous-chefs/mysql#421 is merged. There is a bug in that repository that is causing "source-install-ubuntu-1604" install to fail dealing with the mysql client install.

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024

I rebased the php7/16.04 branch on top current changes and pushed up the latest fixes for Ubuntu. Builds are passing now.

from php.

tas50 avatar tas50 commented on May 14, 2024

Merged and about to ship

from php.

danbuchal avatar danbuchal commented on May 14, 2024

Out of curiosity, why are the default values changed to install PHP 7 only for Ubuntu 16.04?

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024

@danbuchal There are multiple reasons to leave it be.

  1. There is no Debian/Ubuntu maintained package for PHP7 on 14.04. Any choice as for a package to install would come from a PPA or a build from source, and it's hard to support that as the default setting.
  2. PHP5 has been the default install on 14.04 for 2 years. It would be in slightly bad taste to change the default from PHP5 to PHP7 and break with the system default for all users. It's best to allow people to opt-in deliberately to changes like that when it could break backwards compatibility, rather than default to assuming that people will approve.

That was my reasoning when writing the pull request. If you'd like to try getting PHP7 installed on 14.04, you could try installing a PHP PPA OndΕ™ej SurΓ½'s PPA is spoken of highly and overwriting the default PHP packages before running the recipe. You might need to make additional changes to the PHP attributes, however, but the ability to get php7 installed and running should be there.

from php.

danbuchal avatar danbuchal commented on May 14, 2024

My intention with the question wasn't about earlier versions of Ubuntu necessarily... but other distributions altogether. RHEL, etc. It seems this cookbook now has different default functionality based on what distribution you are using. I can easily enough override those for say a CentOS install, but I wanted to point out this discrepancy. Maybe part of these solution is to spell out those differences (if they are intentional) in the readme.

from php.

chriswgerber avatar chriswgerber commented on May 14, 2024

I guess the reasoning then is the maintainers didn't have the time to work together a PR for the functionality and I did so I contributed what I could. The main push for PHP7 on my end was to support 16.04, within which the default PHP version (apt-get install php) installs PHP7. In order to support 16.04, the repository also needed to support PHP7. There was no intent to make the cookbook functionally different, but because distributions and versions are different, they are functionally different by necessity.

from php.

danbuchal avatar danbuchal commented on May 14, 2024

@ThatGerber I understand, and believe me I thank you for moving on this since now I can officially kill the fork I was having to maintain to make this work. This is just a suggestion for the official maintainers.

Thanks again!

from php.

lock avatar lock commented on May 14, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

from php.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.