Good PHP Ide for debugging Codeigniter? - php

I need a PHP ide for debugging my codeigniter website. I tried PhpStorm, Sublime, PhpEd and Netbeans with no success. Weird problems each time.
I just need an IDE to set a breakpoint and see the value of variables.
I'm tired of googling every day. Is there any stright forward way?
Thanks

Here is how to configure PhpStorm to use XAMPP as the web-server and how to install the debugger.
The first thing you need to do is to configure a debugger in your php.ini. Am currently using Xdebugger, if you use this one then just follow these easy instruction click here. Copy the info form php_info() and paste it into that white box. Then download the *.dll file they give you (for windows) and paste to the folder they ask you to.
The second thing you need to do is to configure the PHP interpreter. Follow the images.
Click on PHP and then the browse button in the interpreter section.
Click on the plus sign and then other local
Get the PHP home path e.g /xampp/php/
Then test it, you should be able to use with the browser and in the console (if your only doing stuff with PHP)

If you want to try something new, Try Cloud9.
Online IDE (I love this)
you can setup project from FTP
can sync with GitHub, BitBucket,
can debug/Run
I need https for some of my project testing, thats why I searched and found this.
hope this help.

I highly recommend Codelobster.
It has free PHP debugger and special plug-in for CodeIgniter autocomplete.

Related

PHPStorm Live Edit for php or an alternative (for firefox)

PHPStorm has a nice little plugin called "Live Edit", however it works only for javascript, html, etc. Exept for php...
My question would be simple - is there any way to make it work for php on firefox? I already have local MySQL and Apache server running. Documentation say no, but who knows?
Just as I posted my question, I found an answer myself (happens constantly). Instead of using Live Edit I found quite a nice alternative (and on firefox too!).
What you need is "Auto Reload", a firefox plugin, which detects file changes and reloads page.
Here's a little guide (assuming that you have PHPStorm and XAMMP configured):
Open plugin's settings.
Create new rule.
For Url type: http://localhost/<MyPage>/*
For files, add file or select directory: C:\xampp\htdocs\<MyPage>
Make sure autosych is enabled between PHPStorm and local server.
Click Open in Browser '*.php' on XAMMP Apache
Edit code and see results.

Debugging with eclipse and xdebug won't go past the first line

Yes I have tried searching on StackOverflow and Google for my problem. If you read the entire question you will see that I include a lot of links to previous answers that I found using both.
I have been trying to get XDebug working with Version: Juno Service Release 2 of Eclipse for about the past hour and a half and I'm running into a log of issues. I've already solved most of my problems by using stack overflow and Google.
I followed the steps here first to install the debugger.
I made sure that I added the debugger as a zend_extension as mentioned in this post.
Here are the relevant lines from my php.ini file
zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.collect_params=4
xdebug.var_display_max_depth=999
xdebug.dump.POST=*
xdebug.dump.GET=*
xdebug.show_local_vars=1
I made sure that I edited the php.ini file for the 5.3 version of php that comes with MAMP. At this point the debugger would start even though XDebug does show up when I run php -v.
Since I was still having issues I checked the logs just like someone did here. I noticed this error in the logs:
PHP Fatal error: Class 'Model' not found in ...
After checking the documentation for the latest version of CodeIgniter I noticed that all Models have to extend CI_Model and not Model.
I fixed that and the error is no longer being printed to the logs, but now things just don't work. The debugger won't go past the first line when I try to debug a file.
I'm trying to debug my php application as a PHP CLI Application. When I try to debug the application as a PHP Web Application I get an error message that says:
No tab group defined for launch configuration type org.eclipse.php.debug.core.launching.webPageLaunch
After Googling the problem, I came across this post that suggested that you might not be able to do what I'm trying to do. Since the question was first asked in 2009, I decided to try the second suggestion and check for any updates.
After updating all of my Eclipse plugins I was still having the same problem. After searching on SO some more, I saw that this guy just gave up and tried with NetBeans and got everything to work.
Should I just consider the past 1.5 - 2 hours as a sunk cost and just move on to a different IDE?
I also had issues getting XDebug to work with Eclipse and XAMPP. In the end I decided to go with Netbeans and it was a lot smoother getting it setup. I am still using Netbeans to date for all of my PHP development.
Possibility your Php CLI is picking wrong php.ini file ?
Please go to terminal and check which ini file is loaded by :
php --ini
and make sure its desired one.
jerrod.taylor,
I had a lot of issues when starting use PHP,Xdebug and Eclipse. I considered change IDE myself but I liked the challenge and found a lot of help online. I will try to provide you with some tips will help you.
First of all this is the parameters I have in my php.ini:
zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9060
xdebug.remote_handler="dbgp"
xdebug.remote_autostart=On
I am using local machine as remote host. Adapt for your world. This configuration works for me with CLI and Web debugging. I am really not sure if some of them is specific for different kinds of debug. So, lets start with all of them.
Now, make sure xdebug is been supported. Run the following command and see if exist something not good.
php -i|grep xdebug
NOw, lets go to Eclipse. In Eclipse preferences add the correspondent PHP executable and make sure the debuger type is Xdebug. This step can be done navigating through Preferences->PHP->PHP Executables. If you add an item, the form you ask you for the following information:
Name : Choose one
Executable Path : the_path_to_php_exe
PHP Ini file : you can leave it blank
SAPI type : CLI
PHP debugger : Xdebug
This step is important. It is how we will tell eclipse the executable to use.
Now, lets add a debug configuration. I have one project called upload in my workspace and exist a file index.php on this project. To create a debug configuration click in new when "PHP CLI Application" is selected. It will be add a new configuration form for you. For my Debug configuration I have the following information:
Tab PHP Script
Run Time PHP
Alternat PHP: (Select the PHP executable you have created above)
PHP File : /upload/index.php
Break Point : Break at first line is selected
This steps should be enough to you solve your issues. Let us know how it was.

Step Through (Debug) PHP Code in Netbeans

I have an application I'm working on in which I make many AJAX calls to external PHP files. These PHP files get certain parameters, connect to the DB, and perform a task with them.
I just recently started using Netbeans for an IDE and love it thus far. However, whenever I put a breakpoint on one of my external PHP files (the ones I'm making AJAX requests to) and attempt to run the debugger, my breakpoints are never hit. Am I doing something wrong? Or does the Netbeans debugger not stop on the breakpoints of external files you are referencing?
NetBeans need to be configured to use xdebug, before you can strt debugging. For instructions on installing and configuring xdebug see here: http://wiki.netbeans.org/HowToConfigureXDebug
Here is a nice step-by-step tutorial for setting this up. A little less wordy than the netbeans documentation:
http://arturito.net/2011/05/21/local-and-remote-php-debuging-in-netbeans-with-xdebug-on-google-chrome-just-like-in-visual-studio/

Is there an Editor or IDE capable of returning external program output?

I've got around 14 IDE's installed for testing on my WinXP box right now, from Notepad++ to Netbeans, Aptana to Zend Studio. I'm trying to find one that will do what I need, but no luck finding a solution yet.
My goal is this:
The IDE is open and I'm working on a
PHP file. Click a button or hit a
hotkey...
My IDE sends the file I'm working on
to an external app (Firefox, Lynx,
Chrome, etc.) with any command-line
parameters I specify, processes it,
then returns the output (HTML source,
in this case) back to my IDE in an
output window and/or new file tab.
Seems like a simple request, right? ;)
For clarity, I'm not interested in downloading Win PHP binaries and simply running the script inside my IDE. I've got a virtual server setup (Virtualbox) which perfectly mirrors my live server and really want to use that for generating output and testing. Also, I'm trying to avoid switching back and forth between IDE and browser to check the source.
The Zeus editor can run external applications via it's tool setup and capture the application output to a tool output window.
To add the name of the current file to the tool command line just use the $fn macro tag as a marker when setting up the tool command line.
You can try with External Tasks in any Eclipse-based IDE. Of course, it won't read your mind, so its up to you to configure the task:
http://help.eclipse.org/helios/topic/org.eclipse.platform.doc.user/tasks/tasks-exttools-running.htm
Also, Zend Studio has support for Virtual Machines, though Im not sure if it's relevant to your question.
Gvim, what else? Use a command like this:
:r ! [some command]
And the output from [some command] will be pasted into your current file. Or:
:20,25 ! rot13
Will take lines 20-25, run them through the external rot13 command and put the output in it's place.

NetBeans PHP and XDebug - jumping to methods on call stack?

I'm having trouble with debugging a PHP project through NetBeans using XDebug, and was hoping someone out there might have had this problem before.
Debugging works fine for the requested php file - so if I go to index.php on the remote server, I can put a breakpoint anywhere in index.php in NetBeans and the code stops there and I can step through.
The trouble is, all the other files appear on the call stack like this: "file:///home/user/site_html/library/class.requestprocessor.php" and because that's a path to a file on the remote server, NetBeans is unable to resolve the name, and so I can't step through the code for it. It makes debugging practically useless! The php file that was requested, for example index.php, appears just as "index.php", it's just all the other ones which are included that NetBeans can't resolve properly.
Is there some setting in NetBeans or XDebug that I can use to solve this problem? I have tried my best looking through all the project settings and options in NetBeans, and also looked through all the configuration options of the XDebug extention, but to no avail. Surely someone out there must have had this problem before? How did you solve it? I'll be very grateful if you could let me know.
If there's no other way, do users of Eclipse PDT and XDebug have this problem when debugging on a remote server? If not I'll make the switch.
This issue appears to be fixed in NetBeans 6.7.
Okay it seems no one is going to answer the question, so I'll post the results of my research.
As I was unable to find a way to make NetBeans successfully debug as I wanted, I tried using Eclipse PDT and Visual Studio 2008 with the VS.php extension in order to solve my problem. Eclipse PDT was hell to setup, and I wasn't happy with the way you couldn't specify a port to use for your FTP server in its Remote Server Explorer. I found VS.php did everything I wanted, it automatically uploads the code, as well as having perfect debugging, and it was EASY to setup. The only thing is, it looks ugly and I can't find a way to customise its colours. However, I'm going to choose function over fashion, and so I've settled on using VS.php as my final solution. Which to be honest is a shame, NetBeans was really great, I just can't live without a working debugger.
I had this same issue. I'm running Netbeans 6.8. You have to right click on your project, go to project properties/run configuration/advanced and set up path mapping. Map the folder on the server to a folder locally so that Netbeans knows which files to open locally when it hits these methods.

Categories