Laravel Problem

General discussion forum for the Zend Server

Laravel Problem

Postby alek76 on Thu Aug 31, 2017 12:46 am

Hi guys,

I am using Zend Server and Zend Studio on my macbook. First - congratulations on creating these are great tools! However, I have a problem with the Laravel plugin.

I created a new project inside the Apache DocumentRoot. I used New > Project from Composer package and then i selected "laravel/laravel". After that I went into the plugins sections of the Zend Server UI and in there "laravel 4/5" was sitting as "Waiting for deploy". My first question is what does it mean when a plugin is "Waiting for deploy"?

I then clicked the redploy button on the right side and the plugin got enabled. However when that is on, I am now getting a number of errors.

The page is what looks like a Laravel error page saying

" Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Call to a member function getData() on string"


The file it is complaining about is /usr/local/zend/var/plugins/laravel/zray/zray.php and the line number is 124 which looks like this:

Code: Select all
foreach ($view->getData() as $key => $value) {



This is the trace:

ZRay\Laravel::ZRay\{closure}() /usr/local/zend/var/plugins/laravel/zray/zray.php:124
53 Illuminate\Events\Dispatcher::Illuminate\Events\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:347
52 Illuminate\Events\Dispatcher::dispatch() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:200
51 Illuminate\View\Factory::callComposer() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/View/Concerns/ManagesEvents.php:179
50 Illuminate\View\View::renderContents() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/View/View.php:118
49 Illuminate\View\View::render() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/View/View.php:85
48 Illuminate\Http\Response::setContent() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Http/Response.php:39
47 Symfony\Component\HttpFoundation\Response::__construct() /usr/local/zend/apache2/htdocs/larva/vendor/symfony/http-foundation/Response.php:201
46 Illuminate\Routing\Router::prepareResponse() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Router.php:664
45 Illuminate\Routing\Router::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Router.php:610
44 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
43 Illuminate\Routing\Middleware\SubstituteBindings::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:41
42 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
41 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
40 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:67
39 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
38 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
37 Illuminate\View\Middleware\ShareErrorsFromSession::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49
36 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
35 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
34 Illuminate\Session\Middleware\StartSession::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:63
33 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
32 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
31 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37
30 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
29 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
28 Illuminate\Cookie\Middleware\EncryptCookies::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:59
27 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
26 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
25 Illuminate\Pipeline\Pipeline::then() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:102
24 Illuminate\Routing\Router::runRouteWithinStack() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Router.php:612
23 Illuminate\Routing\Router::dispatchToRoute() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Router.php:571
22 Illuminate\Routing\Router::dispatch() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Router.php:549
21 Illuminate\Foundation\Http\Kernel::Illuminate\Foundation\Http\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176
20 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
19 Fideloper\Proxy\TrustProxies::handle() /usr/local/zend/apache2/htdocs/larva/vendor/fideloper/proxy/src/TrustProxies.php:56
18 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
17 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
16 Illuminate\Foundation\Http\Middleware\TransformsRequest::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:30
15 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
14 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
13 Illuminate\Foundation\Http\Middleware\TransformsRequest::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:30
12 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
11 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
10 Illuminate\Foundation\Http\Middleware\ValidatePostSize::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27
9 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
8 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
7 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:46
6 Illuminate\Pipeline\Pipeline::Illuminate\Pipeline\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:149
5 Illuminate\Routing\Pipeline::Illuminate\Routing\{closure}() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
4 Illuminate\Pipeline\Pipeline::then() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:102
3 Illuminate\Foundation\Http\Kernel::sendRequestThroughRouter() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151
2 Illuminate\Foundation\Http\Kernel::handle() /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116
1 main() /usr/local/zend/apache2/htdocs/larva/public/index.php:55


The same exception is also thrown from the render() method of /usr/local/zend/apache2/htdocs/larva/vendor/laravel/framework/src/Illuminate/View/View.php on 102 but that's already in the trace above.

Other error without trace of where it came from:
[laravel] Call to undefined method Illuminate\Routing\Route::getPath()


Can anyone help?

If I turn off the Laravel plugin - everything works and no errors are shown (apart from some caught exceptopns - is there a way to make it not show the caught exceptions?).

Another question - how do I add Laravel to the zend server libraries so that it gets automatically updated? Do I need to create my own package?

thanks a lot
alek76
 
Posts: 5
Joined: Tue Aug 29, 2017 9:57 pm

Re: Laravel Problem

Postby alek76 on Thu Aug 31, 2017 11:50 pm

OK, I think I might know what the problem is. I was using the latest version of Laravel (5.5) which doesn't seem to be supported by the z-ray plugin yet. I also tried 5.4 but that didn't seem to work either. I then tried 5.1 LTS and that worked fine.

One of the things I have read about Laravel is that they change things quite a lot and they don't care about backward compatibility (not everyone is as good as ZF). If this plugin is a bit older - that could explain the crashes.
alek76
 
Posts: 5
Joined: Tue Aug 29, 2017 9:57 pm

Re: Laravel Problem

Postby zend_eyalt on Sun Sep 03, 2017 12:44 pm

Hi Alek,

thank you for the detailed bug report, opened a bug about it for the team.

BTW - Zend Server guide page comes with links with a few sample apps - the Laravel version supplied there (which works with the Z-Ray plugin) is 5.3.21, so I guess its indeed an issue with 5.4 and above.

thanks,
Eyal
User avatar
zend_eyalt
 
Posts: 251
Joined: Thu Jan 22, 2009 3:16 pm


Return to Zend Server

Who is online

Users browsing this forum: No registered users and 5 guests