Editing PHP Files

Posted on 2009-04-18
Last Modified: 2013-12-13
I had worked on PHP files along with mysql and Apache quite a long time ago.

I am working on some PHP files that I am able to view through localhost on my laptop.

However, it has been a long time and I need to know how to edit / view the source code of the PHP file.

Can someone provide me with a quick refresher on how to view a PHP file under Xampp

Is there an inbuilt editor in Xampp (xampplite-win32-1.7.0)?

How can i change the source or at least view the source in an intelligible manner

Is View source and saving the source in the text file the way to do it?


Question by:Rahul_Hans
    LVL 2

    Expert Comment

    Well since your on a local host you don't have a built in code editor. So you could use Notepad to edit but if your looking for a simple compiler or IDE try using Roadsend.
    LVL 54

    Expert Comment


    You just need a text editor to see PHP source or edit its contents.  Notepad was mentioned but PSPad, EditPad and a number of others are free and will support PHP files, with more features.  PHP files are not compiled and can be opened like any other text editor.

    Let me know if you have any questions or need more information.

    LVL 3

    Accepted Solution

    The latest version of Netbeans is a great free PHP editor, as is Eclipse PDT.

    However, you can't view the source by saving the page from a web browser or selecting View Source. What you see through a web browser is the output of the PHP file once it has been processed by the PHP module of Apache, ie. not the PHP source files themselves.

    To edit the source files directly, look in \xampp\htdocs.

    Author Comment

    Okay. Thanks for the update.
    I had tried to use notepad to edit the .php file in htdocs. However i could not see the php file with proper formatting.
    It was as if the line feeds and carriage returns were ignored and i could not see individual lines properly.
    Can you provide some help?
    LVL 3

    Assisted Solution

    If you use Wordpad instead of Notepad, it should display correctly.

    However, the code will be much easier to read and edit (color coded, line numbers, code hinting, etc) with a proper PHP IDE.

    Download the PHP version of Netbeans for free from:

    Or PSPad from:
    LVL 54

    Expert Comment

    What did you decide to use?

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now