Page 1 of 1

Aimeos Demo out-of-the-box issues on Laravel 5.2

Posted: 17 May 2016, 14:04
by overmountainstudios
I've just installed and configured the demo for aimeos on Laravel 5.2. It looks good and mostly works, but there's a strange issue that I'm not sure how to resolve. If I attempt to add an item to my cart as a user, I get the following error:

Code: Select all

FatalErrorException in Base.php line 0:
Declaration of Aimeos\MShop\Service\Provider\Decorator\Base::__construct(Aimeos\MShop\Service\Provider\Iface $provider, Aimeos\MShop\Context\Item\Iface $context, Aimeos\MShop\Service\Item\Iface $serviceItem) must be compatible with Aimeos\MShop\Service\Provider\Factory\Iface::__construct(Aimeos\MShop\Context\Item\Iface $context, Aimeos\MShop\Service\Item\Iface $serviceItem)
in Base.php line 0
This happens regardless of which product that I attempt to add to the basket. Does anyone know why this could be happening? Did I miss a configuration step?

Re: Aimeos Demo out-of-the-box issues on Laravel 5.2

Posted: 17 May 2016, 14:35
by aimeos
You use PHP < 7.0.4 which has a bug causing the error. Please update your PHP version or use PHP 5.x instead.

Re: Aimeos Demo out-of-the-box issues on Laravel 5.2

Posted: 17 May 2016, 16:30
by overmountainstudios
You are absolutely right. I'm hosting it on a Laravel Homestead vagrant box, and that vagrant image seems to use an older version of PHP7. I had to

Code: Select all

sudo apt upgrade php
I was also encountering issues with apt not being able to find the official PHP PPA. For anyone encountering this issue, the PPA seems to have changed names. I did the following to fix it:

Code: Select all

sudo vim /etc/apt/sources.list.d/ondrej-php-7_0-trusty.list
and I changed

Code: Select all

deb http://ppa.launchpad.net/ondrej/php-7.0/ubuntu trusty main
to

Code: Select all

deb http://ppa.launchpad.net/ondrej/php/ubuntu trusty main
After that, I ran

Code: Select all

sudo apt update
and I was able to update php without issue.