2

I can debug yii web app using netbeans but can't find the way to debug console app. I have enable debug according to instruction here => http://www.larryullman.com/2010/10/07/creating-a-yii-console-application/

But still cannot make my console app break at break point set in IDE. Any suggestion would be appreciated.

Thx

1
  • i found the problem, there are 2 locations of php.ini, one for apache and other for php.exe. i got php.exej's ini location by "php -v" add "xdebug.remote_enable = on" then it work. Commented Sep 15, 2013 at 1:35

1 Answer 1

4

If you can debug web apps in netbeans its very easy to configure netbeans to debug console yii applications.

  1. You must add a run configuration at project properties: Right click at project name, in projects tab and select the properties menu option.
  2. Click in the "Run Configuration" categorie, at left column.
  3. In the field "Configuration" ,Add a new configuration pressing "new..." button and give a name to the new configuration profile (i.e. console config).
  4. In the Run As field,select "Script (run in command line)" option.
  5. In the field "Index File" enter protected/yiic.php
  6. In the "Arguments" field, enter the name of you yiic command and, if needed, other arguments.
  7. Press OK button.

Now you have 2 run configuration profiles. To debug the console app, right click at project name in the Projects and switch to the new configuration profile in "Set configuration" option and use the IDE to debug as usual.

You can create a run configuration for each console command you have.

Regards. Isidoro.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.