I'm trying to set up Eclipse for php web development. What I would like to do is preview a php web page from within Eclipse, but I cannot figure out how to do this. Is there an integrated web server of some sort that allows this, or do I have to set up IIS/Apache to do it? If so, do I have to have my php files in the web servers path, or does Eclipse auto deploy the files to the local web server? Any information or links would be very much appreciated.
There is a plugin for Eclipse called PDT which makes PHP development a breeze.
For an overview on how to install it, you can refer to the Eclipse website:
http://wiki.eclipse.org/PDT/Installation#Eclipse_3.4_.2F_Ganymede_.2F_PDT_2.0
To actually view the PHP scripts running, I would imagine that you'd have to have some sort of server already installed and running. You could probably set the workspace location to be in the server path, and then view the files through localhost. But maybe the PDT package takes care of some of that for you.
I will make it Very Easy ;)
(1) Go to Eclipse home: http://www.eclipse.org/downloads/ and download Eclipse Classic (Current May/2013 version is 4.2.2)
(2)
One you have eclipse fired-up in you machine Do followings : Help > Install Software
Than, Click On Add
Finally, Add this link: http://download.eclipse.org/releases/indigo for all the list of Add-Ons
and pick PHP under Web Addon (Should be last in the list) and Install it.
Restart you eclipse + thumbs-up to my Ans. and Start Coding ;)
I setup apache/php/MySQL on my windows PC, so that testing environment is not totally unlike my servers (excepting the OS, but 90% of the time that's okay). I create alias's in the Apache configuration to the Eclipse workspace, and just hop between the browser and eclipse. The URL for testing is something like:
http://localhost/project_name/file.php
While this isn't ideal, it is a fairly consistent/smooth process that doesn't require a great deal of configuration within Eclipse. I keep thinking there should be a better way, but I honestly don't think I'm burning enough time to justify the research. Once the setup is done, I don't really loose more time after that, and I can control which version of PHP I'm running on my system.
I don't tend to like integrated browsers for testing of web applications anyway. Every time I've dealt with one, it was completely different from a "real" browser that I had to completely retest anyway. At least this way, I have my Firefox testing done when I'm through the first pass of the logic.
try easyeclipse, it the easiest Eclipse setup i've found
"EasyEclipse for LAMP:
For PHP, Python, Perl, and Ruby development with a web server and a database"
I would also recommend downloading and installing WAMP server which is a really easy all in one Windows equivalent (windows, Apache, MySQL, PHP) of what you are likely to have with a commercial web host. See http://www.wampserver.com for details and download.
As well as pdt which had already been mentioned other alternatives are phpeclipse and aptana studio which is based on eclipse.
Visit this website https://eclipse.org/pdt/. Go to where it says 'Update existing Eclipse'.
The procedure is this "In Eclipse, click Help -> Install New Software and work with *: http://download.eclipse.org/tools/pdt/updates/3.6"
Related
I am collaborating on a PHP project with a colleague using GitHub. I want to work on the code in Eclipse, and test the web pages within Eclipse. I have installed eGit and PDK in Eclipse. I think I have imported the project into Eclipse properly. Now I want to test some of the pages in Eclipse so I can get an idea of whats going on. Do I have to install a web server on my machine, or is there something built in to Eclipse for this?
You seem to have the hots for Eclipse, but this is web development, not desktop development. If you want to properly test a web application, it is better to use the most popular browsers to test it in, such as IE, Firefox and Chrome.
You will need a web server, yes, here are a few :
http://en.wikipedia.org/wiki/Comparison_of_WAMPs
Note that those are for windows, but some of them are multi platform, such as XAMPP.
Also, for a web development IDE, I recommend PHPStorm, you can try it for free here :
http://www.jetbrains.com/phpstorm/
The PDT plugin of Eclipse doesn't include a web server with it, you can check the main PDT page where it instructs you to install a web server to run and debug your code.
Newer versions of PHP do include a a built in web server to run code so, technically you don't need a web server, but you should probably set up Apache/Nginx to mimic what your code would run on in a production environment for less deployment headaches.
A quick and easy web server would be XAMPP. XAMPP is easy to set up and run and comes with Apache, MySQL, PHP and some other stuff useful for setting up your development enviornment.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Honestly, I am tired of searching and trying various php debuggers and IDEs from netbeans to jetbrains PHP storm, Eclipse indigo, WAMP, (old zend server community edition) etc!
I need a working set of IEDs and debuggers so I can start developing my work!( I by the way want to develop php scripts in Windows)
Problems:
php storm: weird IDE]
PHP Tools for Visual Studio: it says it is free, but you can try it for free for 30 days
PDT Eclipse: too old, no updates, broken links. Working with Zend itself is creepy
Netbeans 7.3, still not easy to work with. So many settings Xdebug not working
I need something like PHP development tools for Eclipse Juno, any suggestions?
What combinations of IDE(netbeans, phpstorm, Eclipse, Visual stodio) + (Zned server, XDebug) do you guys use? I am really tired of this product not being compatible with one another.
I would really give PhpStorm another try. True, it takes a bit of time to get used to, but it offers a lot of features that are hard to find in other IDEs
Regarding debugging and testing, read these walk-throughs on debugging:
http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
And unit testing:
http://confluence.jetbrains.com/display/PhpStorm/PHPUnit+Installation+via+Composer+in+PhpStorm
Simple Texteditor
Apart from a proper IDE, I always have a 'regular' text editor 'on the side', for example to have a quick 'scratch' file to write down some notes, or to make minor changes in a file without having to open your entire project.
There are many nice editors, Sublime Text, NotePad++ and UltraEdit are some examples.
Test and development environment
Although using WAMP/XAMP is convenient to set up, it is not the best environment to test your project. Most PHP websites will be hosted on a Linux/Using environment, which is quite different from a Windows environment in many ways, some are:
Linux/Unix file systems are Case Sensitive, whereas Windows is not
Linux/Unix uses a slash / as directory separator, Windows uses backslashes \
Some parts of PHP rely on functionality provided by the operating system. Therefore PHP will produce different results on Windows than on Linux/Unix
Linux/Unix uses a different permission system
If you develop and test your websites on WAMP you will encounter unwelcome surprises when you try to deploy the website on the actual hosting environment. Some problems may not even present themselves instantly, which will even be worse (customer calling in the middle of your Holiday telling you that the 'flush cache' admin-panel flushed not only the cache, but also all uploaded content)
So, in order to properly develop and test your website, your development environment should match the targeted hosting environment as close as possible
Inform with your hosting provider what their environment looks like; What Linux distribution are they using? (CentOS? Ubuntu?) What versions of PHP, Apache, MySQL?
Set up your test environment according to this. Either by setting up a development server and installing Linux on that, or running a Virtual Machine on your workstation, for example VMWare or Parallels Desktop (a virtual machine may save you some time, because many pre-installed, ready to use LAMP disk-images exist)
Client side testing
Preferably, make sure you have some computers or virtual machines with a clean install of your targeted audience (Windows XP, Vista? etc) sometimes a clean install is missing plugins/functionality that you assumed are present, causing problems (no Adobe Reader installed? No Flash? Old version of Windows Media Player?)
If your targeted audience are business users, be sure to test your website in the actual environment. Think of pitfalls like Caching Proxy Servers, Firewalls, multiple IP-addresses, disabled JavaScript and Thin Clients (using Remote Desktop). Sometimes those environments are still using Internet Explorer 7 (even 6) because of company policy.
Dreamweaver is by far the best php writting tool, the color code is amazing and the auto complete features are irreplaceable. The only other program i have seen come close in the field of auto complete is zend and that lagged like no other. plus it has built in ftp AND it makes it pretty easy to move on to javascript (IMO)
As far as server software i personally favorite WAMP, but everyone will have their own preference
you can find dreamweaver(trial) here
Wampp is here (pretty sweet webpage):
For PHP, I'd use Notepad++ all the way due to dynamic typing instead of static.
Notepad++ is quite light-weight and won't be in your way.
What sort of debugging do you need? Heavy unit testing and profiling or just print_r type of debugging? Have you tried http://www.firephp.org/ ? It's an extension to Firebug that works really well with AJAX.
There is no Eclipse juno PDT . The latest one is for indigo and that one crashes from time to time.
I use Dreamweaver and Xampp, and occasionally Notepad+++ and Xampp.
As stated in the thread, Dreamweaver has a great color code system and is very user friendly. I suggest it.
xampp
Notepad
I suggest use of Nusphere php ide , its too great for php, it has auto complete features and in built server and you can debug run time, you can also set browser foo debugging your code , its true php debugger, i am using this debugger since last 3years ,its amazing and it has inbuilt ftp feature so you can also debug your ftp file.
Here is link Nusphere
I'm looking for a simple way to publish/retrieve PHP code changes from my local copy in Eclipse to a remote server over FTP/SFTP...
I've explored the Remote Server Explorer a bit but it seems overly difficult to use for simple tasks such as "upload this file to server". Is there a good solution out there? Or do people just generally not do web development in Eclipse? RSE seems great if I want to work directly on the server, but what about publishing on MY schedule?
I've been quite happy with Aptana Studio 2 in the past as it offers everything I need, but it's getting out-of-date and Studio 3 offers a whole new set of problems. Maybe I just need a good, straightforward RSE tutorial.
I'd say it depends on 2 things; what platform you're developing on and the nature of the target server. If you're targeting a live server I'd say always upload manually (unless you're part of a live team), otherwise you could consider a more automatic solution. I use Linux, so I've used rsync and sshfs before, both work well but have their own quirks.
HTH.
At work I use http://andrei.gmxhome.de/filesync/examples.html but it`s for more local/intranet situations (aslo rsync could help here).
And at home I use non-eclipse http://www.cyberkiko.com/page/FTPSync.aspx connected as favorite
But RSE also a good stuff.
I recommand the reverse solution :
Use a remote server, which stock your application.
Sync your local by mount your remote server via SSHFS.
For SSHFS you can do a Linux command like sshfs .
Good : Run without any Eclipse plugin and on all your computers…
Bad : Need desactivate the Eclipse DLTK auto indexer.
Or you can install the Eclipse Plugin «Remote System Explorer» which run SSHFS and do the same stuff.
Good : You have an interface…
Bad :
[…] Which is more complicated than the only one command that you need :p (SSHFS)…
You are now in a specific Eclipse configuration.
The plugin isn't available with some version of Eclipse.
I want to start learning PHP. I have had a look at the various options available to install the PHP+MySQL+Apache combination. But it all seems too cumbersome and a lot of editing to the CONF files always leads to one problem or the other. So I had a couple of questions to ask:
1) How will something like WAMP help me? If I install WAMP, will that be enough?
2) Isn't there some Eclipse like IDE ( coming from a Java Background ), that allows WAMP to be integrated with it? ( Or is typing on Notepad the only option available )?
Please help me out by explaining things a little elaborately. Thank you so much for your time and patience.
i personally use xampp and netbeans for my local web development. you can actually set up the netbeans project wherever you want, so you can just place all your files in the htdocs folder of xampp (at C:\xampp) and edit the files in the folder directly. This will allow you to immediately see any changes you have made by reloading the web page.
xampp allows you to run apache (with mod_php installed and configured) and mysql on your local machine and even includes a handy panel to let you start and stop them at any time.
netbeans has a lot of tools for easy development and support for frameworks like Zend. You can also use it for many other languages should you wish to expand.
I prefer WAMP because it doesn't try to do anything fancy with configurations... when you install it, you get PHP, Apache, MySQL, and phpMyAdmin with each of their default configurations and extensions loaded. It's the same as installing them separately, only they're all in one convenient directory, and you get the handy tray icon to restart services and enable/disable extensions.
As for an IDE, I use Eclipse PHP Development Tools (PDT), but I've heard good things about Netbeans too. Eclipse can do everything Scott described Netbeans being able to do as well. You also might want to look into Aptana which was branched from Eclipse PDT but is now maintained by a different team.
you can go ahead and install xampp from apachefriends, it comes with an apache web server, mysql database, phpmyadmin and a control panel for both servers, and installs fairly quick and with the default settings you will be pretty much set. Not sure what integration you'd want between the editor and the webserver though. if you mean code folding, autocomplete and all that stuff, eclipse has a php-friendly version, and so does netbeans (these 2 are the most popular choices as far as i've seen)
I'm looking for a "SINGLE INSTALLER" solution for PHP Development.
Is there anything out there which will give me a nice IDE, Web Server, Debugger, Database, etc, on a single install image (*.msi or *.exe)?
This of course would be completely opposite of Eclipse PDT, which requires you to search and locate a bunch of additional components which never quite work together.
I think you should go for a separate install for server (web, database) and one for development (IDE, debug) -> Zend or PHPed ?
I think the question is: Does there need to be a true all-in-one solution? I think not.
I agree it's bothersome to have to put dozens of pieces together, but I find a combination of XAMPP, the IDE of my choice, and a few additional bells and whistles (like Polystyle for source code formatting) totally flexible, and not too much work to install.
I don't know if you'll find all of what you're looking for in one package for Windows, but you can get it narrowed down to about two...
XAMPP for Windows comes with: Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, JpGraph, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql.
Then you just need an editor with a debugger, which there are many choices, mostly non-free, such as NuSphere's PhpEd - or free - such as Eclipse PDT or gVim+XDebug+DBGp client.
True one-in-all - not yet. Maybe someone reading this will upload a version.
My tip would be:
XAMPP and Netbeans (The PHP bundle).
2 clicks to install.
3 clicks if you don't have java installed already.
Netbeans is a nice IDE for PHP, too. I use it all the time and I'm much more satisfied with than with Eclipse PDT. It comes in one neat bundle, that you can just install and use right away.
Just download the PHP bundle here
As for a web server, I can recommend XAMPP or Zend Server. They are both easy to install and do a good job. XAMPP has MySQL on board while Zend Server has some really cool optimization features for great performance.
Should it be a requirement that your development environment is easy to install? You're a developer so, you should be able to install and configure a set of (more powerful) tools that suit your specific needs.
You'll only install your bundled IDE once (every so often) so that feature no longer is of benefit when you're developing your projects. It's more likely to become a hindrance as you struggle to configure your environment.
Take a look at Komodo IDE also.
If you're on windows you can get a WAMP package for web,php,database. For IDE I do like Zend Studio 5.5. Not their latest interation based off of PDT. 5.5 has a nice debugger and a built-in web browser that you can view output. The interface is pretty fast, running your code through the debugger/browser is slower than on a real webserver, but ofcourse you get the nice perks of breaking,inspecting your code. The only drawback is that Zend Studio 5.5 is not supported anymore and the highest PHP version that works with it is 5.2.13.
Currently though I have a Virtualbox Ubuntu Server image that mirrors my production enviroment, except it has Samba installed so I can easily copy files back and forth.