10

I'm a rookie PHP programmer and want to find the easiest way to use PHP editor that has a live preview functionality built in. I have a server where I currently test out my new found skills, but saving the files and then viewing in the browser is becoming tiresome and would like to view my changes more instantaneously and without having to wait for my website to load.

All of the suggestions I've found on here are from long time ago and as the programming landscape is ever changing, I'd like the best, latest suggestions.

An easier approach is something I think, I need to progress further.

Can anyone recommend a PHP editor with live preview? Either paid or free is fine.

Also suggestions of some places for PHP learning resources (preferably paid, since it more guarantees the quality) would be greatly appreciated. I've signed up to Teamtreehouse and went through all of their courses on PHP and MySQL.

  • Try brackets.io It is cross platform. I have only used it for AngularJS, but it says that it works for PHP. For Angular, there is a Live Preview where changing even a single character in my JS, HTML or CSS immediately updates the browser, without having to share. Please try & let me know if it works, as I might then start using Brackets IDE for my PHP too :-) – Mawg Oct 28 '15 at 14:59
  • I work on a Linux desktop, so I can duplicate my server environment on localhost. All I do for a live preview is click the reload button in the browser, no IDE or special editor required. :) You could set the same up in a VM on virtualbox, use sshfs to mount the web directory on the VM, and then use any editor/IDE you want. – ivanivan Jun 6 '18 at 13:15
2

One solution is to add auto-saving in the IDE and auto-loading in the browser.

Since your pages are in PHP you'll need some PHP server on your machine. I often use WAMP on Windows, for Mac I don't have much experience but there should be plenty of solutions such as MAMP.

1

If a not-quite-live preview (i.e. one click to view) web-app will work:

PHPFiddle (though at this writing it seems to be erroring out - I presume it is a temporary problem)

It has some built in MySQL tables and you can do some MySQL operations but not all.

It is great for very quickly testing things. For actually editing existing code I don't really like it (because you have to copy and paste into it) but it isn't bad for it.

It does have syntax highlighting and a fairly extensive help section (though I haven't read much of it so can't really comment on the quality of the docs).

It is free.

1

Coda 2 ($75.00) has a "PHP server" built-in, so that you can preview any file after you've saved it. It's really easy to use, except it's got a bit of a high price-line. If you can afford it though, it also has FTP capabilities and synchronisation between clients and servers.

  • I actually purchased this a year or two ago and it's really good. The 'live preview' thing isn't really any good for me, since my dev site is an add-on domain and the live preview always shows my 'main' website. It's a really useful feature though, i just can't use the bugger! – Nikki Mather Apr 23 '14 at 18:27
  • @NikkiMather Do you mean as a subdomain? Then you can just change the site details, so that the local / remote url points to your subdomain, and not your main one. – Lucas - Better Coding Academy Apr 23 '14 at 23:24
0

PHPStorm can:

  • Automatically upload to a server
  • Use the PHP 5.4+ built-in server as an internal server
  • Automatically save and refresh the browser when debugging is turned on.

Learning Resources

  • PHPAcademy and their Youtube channel is really good.
  • Find developer blogs on various topics, Web Dev is more tools than techniques
  • Read documentation. Many tools and frameworks come with tutorials in their documentation
  • Again, Youtube.
  • Typing.io is a typing tutor that uses source code, you may pick up somethings going through it.
0

For PHP dev, I personally use the following, depending on the scenario:

Brackets: http://brackets.io

FoobarPlus: http://www.foobaz.io/plus

VSCode: https://code.visualstudio.com/download

Both are free and will give you a live preview. Hope that helps you out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.