Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 7 packages cannot be found #18

Closed
peterboldizs opened this issue Aug 13, 2016 · 2 comments
Closed

PHP 7 packages cannot be found #18

peterboldizs opened this issue Aug 13, 2016 · 2 comments

Comments

@peterboldizs
Copy link

Greetings!
When I tried to run

ansible-playbook -i inventory -c local main.yml

the following error has occurred:

TASK [geerlingguy.php : Ensure PHP packages are installed.] ********************
failed: [127.0.0.1] (item=[u'php7.0-common', u'php7.0-cli', u'php7.0-dev', u'php7.0-fpm', u'libpcre3-dev', u'php7.0-gd', u'php7.0-curl', u'php7.0-imap', u'php7.0-json', u'php7.0-opcache', u'php7.0-xml', u'php7.0-mbstring', u'php-sqlite3', u'php-apcu']) => {"failed": true, "item": ["php7.0-common", "php7.0-cli", "php7.0-dev", "php7.0-fpm", "libpcre3-dev", "php7.0-gd", "php7.0-curl", "php7.0-imap", "php7.0-json", "php7.0-opcache", "php7.0-xml", "php7.0-mbstring", "php-sqlite3", "php-apcu"], "msg": "No package matching 'php7.0-common' is available"}

Could you please advise?
Thanks.

@TiemenSch
Copy link

PHP7 is not yet included in the stable release of Raspbian (Lite Jessie at least)

I temporarily used the workaround found here to solve this: https://getgrav.org/blog/raspberrypi-nginx-php7-dev . I only followed the PHP7 part. A bash-only summary:

$ sudo apt-get update
$ sudo apt-get dist-upgrade
$ sudo apt-get upgrade
$ cd /etc/apt/
$ cat sources.list
$ sed -i '$ a\deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi\n' sources.list
$ cat sources.list
$ fprint 'Package: *\nPin: release n=jessie\nPin-Priority: 600\n' > preferences
$ sudo apt-get update
$ sudo apt-get install -t stretch php7.0 php7.0-curl php7.0-gd php7.0-fpm php7.0-cli php7.0-opcache php7.0-mbstring php7.0-xml php7.0-zip

This however still missed two more dependencies to be installed manually:
$ sudo apt-get install -t stretch libtool libtinfo-dev

After that the playbook runs just fine (takes a while though!), albeit with code from the "stretch" branch as opposed to stable release branch of Raspbian.

@geerlingguy
Copy link
Owner

Sorry for not responding sooner! The reason you ran into that is because the upstream geerlingguy.php role is now defaulting to PHP 7.0 (and soon 7.1). Raspbian doesn't yet include the version in the default repos (as @TiemenSch mentioned), but I've gone ahead and changed a few other default settings so they'll at least work out of the box now.

I'm going to do a little testing on the Pi today to make sure the instructions are all up to date as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants