zfcampus/zf-apigility-skeleton

Class 'ZF\ContentNegociation\ViewModel' not found with PHP server on Jessie

Jodaille opened this issue · 5 comments

Hello,

I am following the tutorial to create the first REST service.
I have installed Apigility with curl on a Debian/Jessie.

I have a 500 error, when trying to test the ping.
The error is :
Class 'ZF\ContentNegociation\ViewModel' not found
although the vendor/zfcampus/zf-content-negotiation module is present
and defined for loading in : config/modules.config.php

the ping controller is :

<?php
namespace Status\V1\Rpc\Ping;

use Zend\Mvc\Controller\AbstractActionController;
use ZF\ContentNegociation\ViewModel;

class PingController extends AbstractActionController
{
    public function pingAction()
    {
        return new ViewModel(
            array(
                'ack' => time(),
            )
        );
    }
}

The same test on a Mac works, I have disabled Opcache, xdebug with PHP Cli :
I could not figure why it cannot load the module or find the class.

Is there a special configuration I have missed ?

"Works on Mac but not on Linux" often points to a case issue on the file system.

Jeremiah

On Feb 15, 2016, at 3:42 AM, Jodaille notifications@github.com wrote:

Hello,

I am following the tutorial to create the first REST service.
I have installed Apigility with curl on a Debian/Jessie.

I have a 500 error, when trying to test the ping.
The error is :
Class 'ZF\ContentNegociation\ViewModel' not found
although the vendor/zfcampus/zf-content-negotiation module is present
and defined for loading in : config/modules.config.php

the ping controller is :
`<?php
namespace Status\V1\Rpc\Ping;

use Zend\Mvc\Controller\AbstractActionController;
use ZF\ContentNegociation\ViewModel;

class PingController extends AbstractActionController
{
public function pingAction()
{
return new ViewModel(
array(
'ack' => time(),
)
);
}
}`

The same test on a Mac works, I have disabled Opcache, xdebug with PHP Cli :
I could not figure why it cannot load the module or find the class.

Is there a special configuration I have missed ?


Reply to this email directly or view it on GitHub.

Could be a spelling mistake...? ContentNegociation vs ContentNegotiation...?

I should add...If that's the case, don't feel bad. I suspect most of us have spent more time than we'd care to admit searching for a big bug when it's really something silly and simple like...a spelling mistake. I know I have. :-)

Hello,

thank you @telkins It works now with ContentNegotiation :o

👍