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

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
overmountainstudios
Posts: 2
Joined: 17 May 2016, 13:47

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

Post by overmountainstudios » 17 May 2016, 14:04

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?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

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

Post by aimeos » 17 May 2016, 14:35

You use PHP < 7.0.4 which has a bug causing the error. Please update your PHP version or use PHP 5.x instead.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

overmountainstudios
Posts: 2
Joined: 17 May 2016, 13:47

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

Post by overmountainstudios » 17 May 2016, 16:30

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.

Post Reply