How to Run a PHP File in XAMPP

How to Run a PHP File in XAMPP thumbnail
How to Run a PHP File in XAMPP

The XAMPP suite of Web development tools, created by Apache Friends, makes it easy to run PHP (Personal Home Pages) scripts locally on your computer. Manual installation of a Web server and PHP requires in-depth configuration knowledge, but installing XAMPP on Windows only requires running an installer package. This package installs not only a Web server and PHP but also MySQL, FileZilla, Mercury, Perl and Tomcat. These applications allow testing of full websites on your own desktop without the need to upload everything to an online Web server.

Instructions

    • 1

      Go to the Apache Friends website and download XAMPP for Windows. For the easiest install, download the Basic Package's "self-extracting RAR archive." Wait for the download to finish and open it to begin installing XAMPP. Click the "Install" button to start the file extraction. When the Command Prompt screen appears, press the "Enter" key at every question to accept default settings.

    • 2

      Start the XAMPP program. When started, XAMPP loads itself into your icon tray. The icon is orange with a white bone-like shape in its center. Single-click the icon to expand the Control Panel. Click on the "Start" button next to "Apache" to start your Apache Web server. When Apache is running, the word "Running" will appear next to it, highlighted in green. Also start "MySQL" if your PHP scripts depend on a MySQL database to run.

    • 3

      Place your PHP files in the "HTDocs" folder located under the "XAMMP" folder on your C: drive. The file path is "C:\xampp\htdocs" for your Web server. Make sure your PHP files are saved as such; they must have the ".php" file extension. Open up any Web browser on your desktop and enter "localhost" into the address box. The browser will open a list of files stored under the "HTDocs" folder on your computer. Click on the link to a PHP file and open it to run a script.

    • 4

      Create any folders you need to test PHP files in under the "HTDocs" folder. If you create a folder named "scripts," then use the address "localhost/scripts" to open them in your browser.

Related Searches:

References

  • Photo Credit Jupiterimages/Polka Dot/Getty Images

Comments

You May Also Like

  • How to Run a PHP File

    PHP is a programming language designed for Web development and use. Almost every website uses PHP to display content and interact with...

  • How to Convert PHP Files to Microsoft Publisher

    Over the years, file extensions will change meaning as old programs are made obsolete. Currently (2010), a PHP file refers to a...

  • How to Install XAMPP on Windows XP

    XAMPP is an open-source software package that consists of an Apache web server, MySQL server, mail server and several other software programs...

  • How to Run a PHP File Without a .Php Extension

    When PHP is installed and set up on a web server, an association will be created between files that end with the...

  • How to Open a File in PHP

    Reading from and writing to files is one of the most common programming tasks. You can't process data if you don't get...

  • How to Read MS Office Files in PHP

    Microsoft Office documents are common formats used on the Web and on desktop machines. The PHP languages provides you with dynamic tools...

  • How to Edit PHP Files

    PHP is a server side scripting language used in creating dynamic web pages. It is possible to use third-party PHP applications on...

  • How to Run a Batch File in PHP

    Batch files (named for the BAT file extension) are plain text formatted files that execute on Windows computers. The PHP development language...

  • How to Create a Test Web Environment

    Creating a test web environment on your workstation allows you to easily edit your website files and check changes, develop and test...

  • How to Create .Pyc File to Run on Web

    Python is a popular open source scripting language. Unfortunately, as an interpreted, read-on-the-fly scripting language, it comes with the caveat of being...

Related Ads

Featured