zend-framework2laminas-api-tools

Apigility Error after installation and creation of first service of demo


i have just installed Apigility and following the tutorials i have an error. When i try with Postman to call my service i get an error like this

Zend\View\Renderer\PhpRenderer::render: Unable to render template "status/v1/rpc/ping/ping/ping"; resolver could not resolve to a file

My call on postman is like this. http://localhost/demo/api/public/ping

How to solve this problem?


Solution

  • Apigility as part of Zend Framework is now part of the open source Laminas project and is called Laminas API Tools.

    Make sure that Zend OPcache is disabled in your PHP configuration before trying to create your API service.

    Quick steps to verify:

    1. create a phpconfig.php file that displays php configuration for your development server. Do not put this in production. See for details https://www.php.net/manual/en/function.phpinfo.php
    1. open this file on your server http://localhost:8080/phpconfig.php and look for two things a) ZendOPcache - if it is enabled, then look at b) loaded php.ini something like /etc/php7/cli/php.ini
    2. add opcache.enable=0 to the [opcache] section. Even if it is commented out, it is still loaded, you saw it above right?
    3. restart your PHP server / application to verify that Zend OPcache is off and that's it.