Debugging PHP in Aptana 2.0
I'm a real newbie when it comes to PHP debugging so forgive my stupidity. I have a simple html form that submits to a PHP script and I want to debug that script and see what's being sent from the form.
My Aptana has two 开发者_运维百科two PHP interpreters installed; Zend Debugger on port 10001 and XDebug on 9000
I have the Firefox Aptana Addon installed
I have my HTML page on the following url, running locally;
http://3i/latest.html
In the IDE I open the PHP script and add some breakpoints, I then open the latest.html and I click on the debug button. It launches the HTML page in a local webserver running at;
http://127.0.0.1:8000/3i/latest.html
I then fill out the form and submit at which point the debugger tells me the JS Debugger has terminated but it doesn't stop at my break points.
I've had a good read around and I can't find anything which helps me, which makes me think it's something pretty easy and I'm being a bit dumb.
You say that you have both XDebug and Zend debug installed - did you make the appropriate modifications to your local php.ini? You can't have both running at the same time - debuggers act as application controllers, communicating with your web server and giving it orders to stop, pause, or continue execution of your script and having two of them configured at the same time can cause unexpected debugging behavior like you described.
Assuming you want XDebug, you would open up php.ini, search for [XDebug] (or [Zend]). Comment out all the zend_* options and put the following options in:
[XDebug]
;; Only Zend OR (!) XDebug
zend_extension_ts="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=true
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\xampp\tmp"
Yes, I know I'm on Windows at the moment - don't splutter. Replace the extension path with the appropriate path to XDebug on your server. If you are wanting to use Zend Debugger then it is much the same, just disable XDebug. Don't forget to restart your web server.
EDIT - I may have been unclear; you can have both installed, you just can't have both running at the same time.
My guess is that you don't have a PHP enabled web server running on your local machine. Aptana 2.0 (unlike Aptana 1.5) does not come equipped with a built in PHP enabled web server. To confirm this, go to your link (http://127.0.0.1:8000/3i/latest.html) in Firefox and view source. If you see the actual PHP source code, that means it isn't being run through a php enabled web server.
There are many good options for PHP web servers out there (e.g. XAMPP, WAMP, EasyPHP, UniServer), do some googling and install one. You'll have to setup an Apache alias to point to your Aptana workspace and you may have to install xdebug separately as well.
Honestly Aptana 2.0 is not a very good PHP IDE. I would stick with Aptana 1.5 which does come equipped with the built-in php enabled web server.
精彩评论