How to run PHP Program for the first time?

7:45 AM

The easiest way to run a PHP Program for the first time is using the software bundle named XAMPP:


  • XAMPP works well in all the major platforms: WindowsMac and Linux.

         You don't have to install ApachePHP and MySQL separately, in fact, it is often difficult          for beginners to install these bundles separately and combine them to run PHP CODE.           XAMPP does that for you with just a few clicks.

  • Before you install XAMPP, you may have to uninstall existing Apache and MySQL installations, especially if they were installed as a service.
After you install XAMPP,
  1. 1. Open any Text Editor.
  2. 2.Install new if you don't already have any good Text Editor installed.(Notepad ++ )
  3. 3.Write the following PHP Program / CODE in the Text Editor:
  4. Save the file in......XAMPP Installation Directory \ Web Root Directory     
  C:\xampp\htdocs\myfolder(create my folder this directory).


4.  When you save the file, name it first.php (just as an example, any valid file name with .php in the end will work).
               
Note: when you save this file, make sure it has no .txtextension at the end. Some text editors place .txt at the end of file name, so it becomes first.php.txt instead of first.php. To avoid this, when you save the file using any text editor, place double quote around the file name: e.g. "first.php"

5 .Then, go to XAMPP installation folder (typically,C:\xampp) and run xampp-control.exe by double clicking it.

6. In the xampp-control window, click the start button beside Apache. Later, if you need other options like MySQL, you'll also have to start MySQL by clicking the start button beside MySQL in the XAMPP control Panel.
     Note: if your OS hides common file extensions, then you'll see xampp-control, instead            of xampp-control.ex
7 .Now, in your web browser's address bar, type the address: http://localhost/my folder/first.php
8. Then Click on First.php ....

Thanks Your Program Is Run....

You Might Also Like

0 comments