Debug Zend Application post_stage script

General discussion forum for the Zend Server

Debug Zend Application post_stage script

Postby jimm2354 on Wed Jun 22, 2016 9:57 am

Hi,

I'm trying to debug my post_stage script of a Zend Application package.

I set a breakpoint and use xdebug to debug the application, when installing the application trough zend studio I only get this in the logs,

/usr/local/zend/bin/php -d html_errors=0 -d display_errors=stderr -q /usr/local/zend/tmp/zdd/.Zt9339/post_stage.php exited with status 255. .

It dosent seem to stop at my breakpoint.. so, Is it possible to debug the post_stage script somehow?

The status where im at right now is that ive activated xdebug and did set it up to remote debugging, using a guide..
Still the debugger dosent seem to start when the application package post-scripts are running, I only see the log error message above in the logs.

I don't know what to do now, and would really need some advice.

Thanks.
jimm2354
 
Posts: 8
Joined: Tue May 10, 2016 3:57 pm

Re: Debug Zend Application post_stage script

Postby zend_eyalt on Wed Jun 22, 2016 11:31 am

Hi,

Are you using by any chance Zend Server 9 ?
If so, then here's a way to find what is going on in your script without actually debugging it, using Z-Ray:
In Zend Server UI:
1) Z-Ray->mode: make sure Z-Ray is enabled
2) Z-Ray->settings->advanced: make sure Z-Ray is enabled for CLI execution

Now when you'll run the application deployment, the app setup scripts CLI calls (such as post_stage.php) will show in the Z-Ray->Z-Ray History page, where you should fairly easily find the problem with your script.

The method above will only work on ZS 9 as both CLI support and the Z-Ray history page were introduced in this version.
User avatar
zend_eyalt
 
Posts: 251
Joined: Thu Jan 22, 2009 3:16 pm

Re: Debug Zend Application post_stage script

Postby jimm2354 on Wed Jun 22, 2016 2:39 pm

Hi eyalt,

Im using Zend Server Version: 8.5.2
jimm2354
 
Posts: 8
Joined: Tue May 10, 2016 3:57 pm

Re: Debug Zend Application post_stage script

Postby zvika on Thu Jun 23, 2016 2:22 pm

Hi
There is a library for deployment script you can include, which offers functionality for deployment scripts but also can start a debug session with Zend Debugger client (this will run the PHP script AGAIN with debug session).
https://github.com/zend-patterns/ZendSe ... mentHelper

You can also use a logfile which is accessible to read later, and place debug outputs in it for deployment scripts actions. Actually logging the deployment scripts is a good idea in general, especially when it holds business logic or important resource modifications (in fresh deployment, upgrades and rollbacks if you use those).

hope this helps.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 986
Joined: Sun Dec 14, 2008 9:48 am


Return to Zend Server

Who is online

Users browsing this forum: Google [Bot] and 4 guests