-1

I have Eclipse PDT and Zend debugger installed and I want to test my php code before uploading it into a remote server. My code needs to read some values in the remote files I don't know how configure PHP debugger in Eclipse for that case. Then I tried to test it locally but I think I have to setup a server in my computer, am I right?. By the way, Eclipse offers me to create servers by downloading server adapters, and there are several options. I'm really confused. What do you think about Chrome extension for debugging php ? is it a quick solution?

Balaji Kandasamy
  • 4,115
  • 10
  • 36
  • 58
JoeCoolman
  • 480
  • 3
  • 8
  • 25
  • For the server part, look at something like [xampp](http://www.apachefriends.org/en/xampp.html‎) to get up and running quickly on your local machine. – Colin Fukai Aug 03 '13 at 08:07
  • if you juste want to check for parse error, you can run php in the terminal with you php file like $php index.php – Nicolas Manzini Aug 03 '13 at 08:26
  • 1
    @NicolasManzini if he just wants to check for parse errors, he can run php from the command line with the `-l` flag to lint the file without executing it. – Gordon Aug 03 '13 at 08:29
  • 1
    @Gordon I didn't know that flag, that's cool thx – Nicolas Manzini Aug 03 '13 at 09:45

1 Answers1

4

I want to test my php code before uploading it into a remote server

In order to test your code, you write Automated Tests. That way you don't need to verify manually each time you change something. See unit, integration and system tests for PHP applications

Then I tried to test it locally but I think I have to setup a server in my computer, am I right?

No. Zend Debugger allows you to step your local code. And you can also execute the code by just running the script and check it's output. However, if you want to test by clicking through your application's UI, then you need a webserver. PHP has a built-in webserver though, which might be sufficient for that purpose. See Are there any php frameworks contain small webserver and rich console tools like RoR/Django?

On a side note, Eclipse with PDT and Zend Debugger is not Zend Studio. If you want to use Zend Studio with a local server, consider installing Zend Server Community Edition which will setup the entire PHP stack for you for out of the box usage. No fiddling with getting Zend Debugger running with XAMP. Questions about Zend Studio and Server are best asked at http://forums.zend.com btw

Community
  • 1
  • 1
Gordon
  • 296,205
  • 68
  • 508
  • 534