Brackets Php Live Preview Xampp

  1. Brackets Php Extension, From Brackets 1.14 version, the Brackets code editor supports PHP using the PHP on 'Live Preview' and you are ready to run the PHP files in your computer. In Brackets go to File - Open Folder (Ctrl + Alt + O) open up the folder containing your php files (i.e. Index.php), then open up your index.php, click live preview and type in http://localhost/.
  2. Install Xampp server. After writing a php code in brackets, start the apache and mySql services in xampp control panel. Now create your own new folder (e.g myCodes) in the htdocs folder of xampp. Place your php code file in this folder (myCodes). Now in Brackets, file - open folder- (browse the htdocs folder and choose (myCodes) folder).
  3. Turn off the live preview mode. Open any UTF-8 file. Eg:- file.html file.php 3. Now turn on live preview mode.
  4. XAMPP stands for Cross-Platform (X), Apache (A), MySQL (M), PHP (P) and Perl (P). It is a simple, lightweight Apache distribution that makes it extremely easy for developers to create a local web server for testing purposes. Everything you need to set up a web server – server application (Apache), database (MySQL), and scripting language.

XDEBUG enables you to walk through the execution of PHP source code and debug the code as it is executed in real-time. It is one of the most important tools that a PHP developer's toolbox and is well worth the time it takes to learn how to use it.

The following instructions will guide you to setting up Xdebug in the Backets editor. It is actually pretty straight forward once you know how.

It is assumed that you have already installed Brackets text editor and XAMPP (64-bit is faster) web server in C:XAMPP. For this article, we will be doing this on Windows. If you have not already done so, set these up first. Initially, you will need to set-up your development environment :

  • Install PHP Debugger in Brackets
  • Enable XDEBUG in php.ini
  • Install the XDEBUG Helper browser extension

Once you have your environment installed, you will be ready to start debugging PHP code anytime you need it.

私はXAMPPで環境設定しているので、Cドライブ直下のxamppの中にphp.exeが入っていました。 これで保存して、一度再起動します。 Brackets を再起動し、ライブプレビューを起動させると、今度は別のポップアップが表示されます。.

Installing PHP Debugger in Brackets

The Brackets PHP Debugger extension is available for free and is easily installed from the Brackets extension library.

1. Install the PHP Debugger extension in Brackets.

2. Click DEBUG > Open Preference Files

3. In brackets.json, add the following highlighted lines (there may already be other lines):

Php

Don't forget the commas after the 'false' on the wordWrap line.

4. Save.

5. Restart Brackets.

Enabling XDEBUG in php.ini

Brackets Php Live Preview Xampp Download

XDEBUG actually comes bundled with XAMPP. You need just activate it though the php.ini configuration file.

1. Start XAMPP

2. Click on the 'Config' button for Apache and select php.ini.

3. Add the following lines at the bottom of the file. If you already had an [XDebug] section, update the values for each of the settings:

Preview

4. Save.

5. Stop Apache in XAMPP.

6. Start Apache in XAMPP.

Installing the Xdebug Helper browser extension

Install the Xdebug Helper extension in Chrome or Firefox. Note that you should go into the extension's settings to ensure that the IDEKEY is set to Other and xdebug

Note: If you change editor, you may also need to change the IDE Key in Xdebug Helper.

Debugging PHP code in Brackets

Although not a requirement, two screens is highly recommended when debugging code, one for the editor and the other for the web browser.

1. In Brackets, open the PHP file that you want to start debugging.

Php

2. Click on the PHP Debugger icon on the right side of the editor. This will open the debugger at the bottom of the screen.

Xampp

3. Set a breakpoint in your code by clicking on the empty space to the left of the line number. Note that you can only set breakpoints for lines that actually contain executable code.

Brackets Php Live Preview Xampp

4. Back in your web browser, click the Xdebug Helper icon and select Debug.

5. (re)Load the page which makes use of the code you want to start debugging.

Note that your page may only appear partially or not at all in your browser. Do not panic. This is perfectly normal since the execution of PHP has been paused.

6. Now switch back to Brackets. You will find that it has interrupted your code at the breakpoint and is waiting for you to take action.

Here you can inspect the value of PHP variables in the right-hand column of PHP Debugger or click on Step Into, Step Over, Step Out, Run or Stop execution of your code. You can also type PHP commands at the command prompt or just type the name of a variable there to see its value.

If you don't see the variables, use the scroll bar on the right edge of the PHP Debugger window to scroll down.

Related Posts:

XAMPP is an easy to install Apache distribution containing MariaDB, PHP, and Perl. Just download and start the installer. It's that easy.

  • XAMPP for Windows7.3.28, 7.4.18 & 8.0.5

    VersionChecksumSize
    7.3.28 / PHP 7.3.28What's Included?
    • md5
    • sha1
    155 Mb
    7.4.18 / PHP 7.4.18What's Included?
    • md5
    • sha1
    156 Mb
    8.0.5 / PHP 8.0.5What's Included?
    • md5
    • sha1
    157 Mb

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 7.3.28, phpMyAdmin 5.1.0, OpenSSL 1.1.1, XAMPP Control Panel 3.2.4, Webalizer 2.23-04, Mercury Mail Transport System 4.63, FileZilla FTP Server 0.9.41, Tomcat 8.5.65 (with mod_proxy_ajp as connector), Strawberry Perl 5.32.0.1 Portable

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 7.4.18, phpMyAdmin 5.1.0, OpenSSL 1.1.1, XAMPP Control Panel 3.2.4, Webalizer 2.23-04, Mercury Mail Transport System 4.63, FileZilla FTP Server 0.9.41, Tomcat 8.5.65 (with mod_proxy_ajp as connector), Strawberry Perl 5.32.0.1 Portable

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 8.0.5, phpMyAdmin 5.1.0, OpenSSL 1.1.1, XAMPP Control Panel 3.2.4, Webalizer 2.23-04, Mercury Mail Transport System 4.63, FileZilla FTP Server 0.9.41, Tomcat 8.5.65 (with mod_proxy_ajp as connector), Strawberry Perl 5.32.0.1 Portable

    Windows 2008, 2012, Vista, 7, 8 (Important: XP or 2003 not supported)

    Windows XP or 2003 are not supported. You can download a compatible version of XAMPP for these platforms here.

  • XAMPP for Linux7.3.28, 7.4.18 & 8.0.5

    VersionChecksumSize
    7.3.28 / PHP 7.3.28What's Included?
    • md5
    • sha1
    151 Mb
    7.4.18 / PHP 7.4.18What's Included?
    • md5
    • sha1
    154 Mb
    8.0.5 / PHP 8.0.5What's Included?
    • md5
    • sha1
    152 Mb

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 7.3.28 + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 7.4.18 + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 8.0.5 & PEAR + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

    Most all distributions of Linux are supported, including Debian, RedHat, CentOS, Ubuntu, Fedora, Gentoo, Arch, SUSE.

  • XAMPP for OS X7.3.28, 7.4.18, 8.0.5, 7.3.28, 7.4.18 & 8.0.5

    VersionChecksumSize
    7.3.28 / PHP 7.3.28What's Included?
    • md5
    • sha1
    162 Mb
    7.4.18 / PHP 7.4.18What's Included?
    • md5
    • sha1
    164 Mb
    8.0.5 / PHP 8.0.5What's Included?
    • md5
    • sha1
    162 Mb
    7.3.28 / PHP 7.3.28What's Included?
    • md5
    • sha1
    359 Mb
    7.4.18 / PHP 7.4.18What's Included?
    • md5
    • sha1
    359 Mb
    8.0.5 / PHP 8.0.5What's Included?
    • md5
    • sha1
    358 Mb

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 7.3.28 + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 7.4.18 + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 8.0.5 & PEAR + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 7.3.28 + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 7.4.18 + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

    Includes: Apache 2.4.47, MariaDB 10.4.18, PHP 8.0.5 & PEAR + SQLite 2.8.17/3.35.5 + multibyte (mbstring) support, Perl 5.32.1, ProFTPD 1.3.6, phpMyAdmin 5.1.0, OpenSSL 1.1.1k, GD 2.2.5, Freetype2 2.4.8, libpng 1.6.37, gdbm 1.8.3, zlib 1.2.11, expat 2.0.1, Sablotron 1.0.3, libxml 2.0.1, Ming 0.4.5, Webalizer 2.23-05, pdf class 0.11.7, ncurses 5.9, pdf class 0.11.7, mod_perl 2.0.11, FreeTDS 0.91, gettext 0.19.8.1, IMAP C-Client 2007e, OpenLDAP (client) 2.4.48, mcrypt 2.5.8, mhash 0.9.9.9, cUrl 7.53.1, libxslt 1.1.33, libapreq 2.13, FPDF 1.7, ICU4C Library 66.1, APR 1.5.2, APR-utils 1.5.4

Add-ons

Applications

Install your favorite apps on top of XAMPP. Bitnami provides a free all-in-one tool to install Drupal, Joomla!, WordPress and many other popular open source apps on top of XAMPP.

Brackets Php Live Preview Xampp Tutorial

OS X native modules have been deprecated. Please use XAMPP-VM for OS X and the Linux version of the add-ons. Check our FAQs for more info.