Live HTML & PHP editor/IDE for PC? - php

Are there any IDEs on PC which will allow you to view your changes live as you are typing? / Can any IDEs you know of be set up to do that?
For both HTML and PHP ideally?

You could stick a meta refresh in your head, but that will get ugly if you have a lot of php parse errors. You could put the page you want to test inside a frame and have some javascript refresh that frame every few seconds too. Then you could use any IDE and browser you want!

Zend will do this. But be forewarned that seeing a bunch of unfinished PHP code is very ugly. I'd suggest sticking with refreshing your browser.
Oh, and if you actually do anything with that PHP code, like request an RSS feed, you would be making hundreds of calls if it ran the PHP code often.

The PHP PDT has a debugging tool (plus other cool stuff like type hints, auto-complete and etc.) and allow you to preview your code in a browser. Install xampp, host your php files on your localhost, and you should get almost what you want.

I recommend you netbeans .its free. it is available for all platforms, and mostly it is good for editing php, jsp, java, css, html, ...
Good for SVN, mercurial, Plus you can integrate it easyly with kenai.com...
it helps with the IntelliSense kind of pop up.
believe me, i'm using it for php development and its the best suited ide i can find...

Eclipse with PHPEclipse does have live error and syntax highlighting.

Related

Is there a way to make Visual Studio Code recognize HTML syntax in PHP files

I am using Visual Studio Code on a Mac to work on WordPress applications.
Is there a way to make Visual Studio Code recognize HTML and use it's features (mainly autocompletion) inside PHP files?
I've searched for this answer before but just get told to Go to Visual Studio Code Settings: File >> Preferences >> User Settings
// Place your settings in this file to overwrite the default settings
{
// Configure file associations to languages (e.g. "*.extension": "html"). These have precedence over the default associations of the languages installed.
"files.associations": {"*.php": "html"}
}
But doing this makes you lose all PHP support and autocompletion.
I wish Microsoft would realize that PHP developers commonly use PHP and HTML together when creating applications/websites. I would love to use VS Code instead of the magnificent but expensive PHP storm if possible.
You can install this plugin:
PHP Intelephense
As far as I can tell, it does. Take a look at this php file I have created in VS Code (no extensions), with HTML inside the file with syntax highlighting for both languages.
There is a button (It should say the word PHP) in the bottom right corner of the screen that allows you to switch the syntax highlighting and autocompletion to another language, and while this does temporarily turn off PHP syntax, it will allow you to code in HTML a lot easier.
You can enable html support in any language by adding the following to your settings.json file:
"emmet.includeLanguages": {
"your-language": "html",
"rust": "html",
"php": "html",
"javascript": "html",
}
Very easy solution
Search emmet in settings and remove php form Emmet: Exclude Languages list
This will definitely work for everyone
I also faced this genuine concern while learning PHP, and the only solution I came up with at the moment is clicking on PHP button on bottom right corner of VS Code screen.
I am attaching the screenshot below with that PHP button highlighted so you would be able to locate it easily. Once clicked it will ask for a language you want autocomplete to work on, select HTML and it would start autocompleting html, click again to enable PHP autocomplete.
I also happened to come across GitHub Pilot Extension, you need to be a student for availing this service for free or you'll have to buy membership, It is a good tool for auto complete although that is not the gist of it's use, It is something great invented for learners and also professional coders.
I used to use PHPEd and it has content-aware autocomplete. It knows the content that your cursor is in: php, html, css, js, etc and suggests tags/attributes/functions/etc based on the language where the cursor is. The entire problem with VSCode is its decidedly unintelligent “intellisense” that relies wholly on what language the document is defined as. Any IDE worth its salt is going to have content aware auto-completion. The only satisfactory answer to your question is make your own snippets and turn off emmet and php auto-completion.

html/php debugging

I am starting a website, thus I'm learning how to program in html/css/php. For other languages I have learnt so far, there has always been an IDE or interactive console that I can type in codes directly to see how they works, access variable types etc., which makes learning and debugging a breeze. (E.g. bash, python, matlab, perl, tcl...)
Can I do the same for html and php? In the spirit stackoverflow's questions style, lemme try to make the questions a little more specific.
I know I can use php interactively on a terminal.
But that is insufficient if I want to see how it works in a html script.
Is there a browser/IDE with a console where I can input commands interactively and see the results?
For PHP:
I'd suggest to use Xdebug.
Read through this article: Debugging techniques for PHP programmers.
Note about debugging production.
For your markup:
Read Firebug-like debugger for Google Chrome.
Also, you might try Web Developer extension.
I find enabling errors is handy for general debugging. With it enabled you can see where the script failed and hone in on the error quite easily. For more advanced stuff Xdebug has it's place.
Combined with a local WAMP installation you have a great start point. Save the php script, execute it and combined with "Firebug" (FF extension) and you have a decent "beginners" tool set for debugging.
you can make your browser your ide. i do, check it out:
handy article showing how to output php to browser console. http://sarfraznawaz.wordpress.com/2012/01/05/outputting-php-to-browser-console/
as for html, download web developer extension for your browser, and validate your markup to test/debug.
You might be interested in something like Cloud9 IDE.
Check them out at: www.cloud9ide.com

Why notepad++ autocomplete doesn't work with function arguments?

I checked "Settings > Prefences > Backup/Auto-Completion > Enable Auto-completion on each input" and "Function parameters hint on input" options. I have Notepad++ 5.9 (unicode) version. It auto completes function names but not their arguments. Also i tried re-install. I know it has this feature but not working. Any idea why?
I mean it auto completes print_r when i write "pri" but i want it to work like in the image;
http://i51.tinypic.com/3322auc.jpg
Hmm, this is not an answer to your question but I want to share it anyway.
I have used Notepad++ for years. I didn't like Eclipse and NetBeans is just so damn slow.
I never used the auto complete function for anything.
Notepad++ can't really do any code analysis, it can only give you auto-completion on the known PHP functions.
I've since switched to an IDE that does full code analysis and can do auto-completion for your own code as well.
Notepad++ is great if you just want to write something real quick. It's also a great tool if you want to learn about PHP since it doesn't do auto-completion very well ;) but if you really want to be productive when you're working on a large application I recommend you use an IDE that does code analysis. Productivity is the key here. I spend less time looking through files and more time actually writing code, which is great! :D
Good IDEs for PHP: NetBeans, PHPStorm, Eclipse.
For this feature to work, you need to supply an .xml file which contains the appropriate functions and parameters.
An example for Javascript with installation instructions can be found here.
I have not yet found xml files for PHP (or Python, which I'm looking for). But it seems this can work in npp, you just need to locate the right xml file.
Best of luck!
(Oh, and don't listen to the naysayers who are too quick to give up, npp works fine as an IDE.)
Notepad++ it's very good text editor, but it's not IDE.
Try to use IDE - NetBeans or PhpStorm, and you will get much more than just smart autocomplete.
I have a same question about this, function hint is Ok,but param hints not display until I download a new release of notepad++(a not install release), all is ok. before, I tryed many time, and edit the xml files.
If you will edit you own language, Can copy from a exist language xml ,for cpp.xml in plugins/APIs folder. It's easy to understand its rule.
It is very easy to have a error, if you config file is changed.

PHP code analayzer and other tools

I am new to PHP (worked around 7 years on ASP.NET)
We are looking for some tools for PHP which we can use to make sure code quality is good.
we are using Notepad++ as a IDE and SVN for code repository.
I became a convert to Netbeans after using NP++ for quite some time. It's got some cool formatting and on-the-fly code checks, as well as very thorough autosuggests and integration with version control (subversion for me)
My coworkers use Rapid PHP which is just about identical, though it has a great block highlight feature.
Separate of editors, I can say enough how great the W3 validator is for making sure the output is really good. Often times it can help you spot missing or misplaced end tags or other minor html issues like that. After Netbeans, firebug, and Chrome Inspector, I'd say it's one of my top used tools.

PHP syntax highlighting in Visual Web Developer?

I recently installed PHP 5 on IIS, however, I am unable to find a PHP syntax highlighting plug-in or extension for VWD. Where can I find a plug-in? I thought there was an official one.
Consider PHP IDE for Visual Studio.
http://www.jcxsoftware.com/vs.php
I have used this and it adds a lot of nice PHP specific features to Visual Studio.
From their site...
Editor and File Management
•PHP4 and PHP5 Support
•Syntax Coloring for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT
•File templates for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT
•Intellisense for PHP, Smarty, HTML, JavaScript, CSS, XML and XSLT
Debugging
•XDebug and DBG support
•Debug PHP, JavaScript and .Net in one single session
•Built-in Apache web server for ease of debugging. Preconfigured with Php4, Php5, XDebug and DBG.
I've tried a lot of text editors, some free, some commercial. So far Visual Studio is the only one that has the right combination of features to be most useful to me. So, coding PHP in VS is important to me.
You can trick Visual Studio (and hopefully also Visual Web Developer) into thinking .php files are C++ with a registry hack. The syntax highlighting is close enough to be useful.
This blog post explains how to do it for all versions of VS: http://blog.cumps.be/visual-studio-2008-and-php-coloring/
I don't know about older versions, but VWD 2010 allows you to link any extension to any type of formatting in its options.
Tools->Options
click 'show all options'
Expand 'Text editor'
click on 'file extensions'
type in 'php' and select how you want it to be formatted (I recommend the Automatic Editor Selector), click Add
And there you go! Next time you load the page you will see the changes. If you don't like it, there's 20 other styles to choose from.
There is no official plugin for PHP for Visual Web Developer. I believe that this is because Microsoft would rather you use their .NET products, (notably ASP) which serves most of if not all of (I can't exactly say as I don't really use ASP as much as PHP) of the functionality of PHP.
There are however, some very good PHP IDEs out there. A list of which you Here
thx, I use the last post with "HTML format" instead "automatic editor selector"
I would recommend using Netbeans. It has code completion for PHP and runs xdebug for debugging. I've been using it for over a year and the support for PHP just keeps getting better.
Definitely worth trying.
I would recommend Visual Studio with this Extension :
http://phalanger.codeplex.com/
It is free and gives you more functionality than most of the expensive tools.
if you're using windows there's an application called notepad++ that will do syntax highlighting for dozens of languages. I used it for C but I know it has a php syntax highlighter and many more languages coming along. Check it out on sourceforge. If your using Linux or Unix you can use K Advanced Text Editor (kate). It also has a console window built in.
What I am looking is for a debugger for PHP that is as useful as the one built into Visual Studios. I searched high and low for this and there seems to be none that works well.
What I used is the PHP Designer 2007 - Personal Version 5.0.2 is a fully functional php editor, for free! from mpsoftware[dot]dk/, however I like using MSVWD a lot too, and now that I've seen how to make php files work in it, I gonna stick with that! Thanks!
btw Aptana Studio looks promising too tho
The closest Visual Studio like PHP environment I have found yet is CodeLobster. It has a free version for PHP and CSS, as well as for pay versions that include for the Pro version a plug-in for CakePHP, CodeIgniter, Drupal, Facebook, JQuery, Joomla, Smarty, Symfony, WordPress and Yii.
It isn't perfect, but it is pretty good and free for the basic version.

Categories