Getting started with PHP in Eclipse IDE

故事扮演 提交于 2019-12-08 08:43:38

问题


I am a Java programmer, but recently got a job working with PHP and mySQL. I looked up good IDEs for this (I previously used Netbeans) and Eclipse was recommended.

When I tried to start working, I got the following error message:

Error launching 'firstfile'

The debug session could not be started.
Please make sure that the debugger is properly configured as a php.ini directive."

I looked this up on Google and tried a bunch of the solutions proposed. I even re-installed Eclipse.

I have the following:

  1. eclipse-php-helios-win32 (full)
  2. WampServer2.1

My configuration is under Window->Settings->PHP->PHP Executables is:

Name: exec-wamp
Executable Path: C:\wamp\bin\php\php5.3.5\php.exe
PHP ini file: C:\wamp\bin\php\php5.3.5\php.ini
SATI Type: CLI
PHP debugger: XDebug

NOTE: I tried to switch debuggers to Zend Debugger and this did not help.


回答1:


Check out the resource at http://www.xdebug.org/docs/install#configure-php and make sure you have everything configured as-described.

Specifically:

  1. Ensure that your debugger is set up correctly in php.ini
  2. Uncomment the string in php.ini
  3. Restart your web-server (if you are on modphp)
  4. Make sure that in your phpinfo() you have set xdebug



回答2:


Just go to http://www.zend.com/products/studio/downloads and download the "Studio Web Debugger". Follow the instructions given in the Installation guide (http://static.zend.com/topics/Zend-Debugger-Toolbar-Installation-Guide.pdf). Trick is to choose the right ZendDebugger.dll (or .so) corresponding to your PHP version.

With these steps, you can run your PHP program as a script and the output appears in the console. Hope this helps.




回答3:


Aptana Studio works great for PHP and is built on Eclipse. It can be used as a standalone IDE or as an Eclipse plugin. It gives you all the benefits of Eclipse plus a lot of extra stuff that makes doing web development in PHP, JS, and HTML/CSS a joy. See http://www.aptana.com/




回答4:


Do you have correct zend_extension variable for debugger? Use phpinfo, to check.

http://www.eclipse.org/pdt/articles/debugger/os-php-eclipse-pdt-debug-pdf.pdf Scroll-down to Troubleshooting in the pdf.




回答5:


I started with NetBeans after using Eclipse for many years. Eclipse is pretty good. Downsides, though, are that many plugins come bundled and don't communicate with the core, as you can see in the error log. :\

You might check out the Aptana build on Eclipse, which is good with JavaScript. PDT (PHP Developer Tools) is also really good for PHP. If you use the two together on Eclipse, though, you'll have a lot of conflicts.

I'd try NetBeans for PHP. By default, it installs all you need for PHP, MySQL, CSS and JavaScript.



来源:https://stackoverflow.com/questions/6020519/getting-started-with-php-in-eclipse-ide

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!