What is a PHP file and how do I run them? Step by step

PHP is one of the most popular languages most used today for the design of applications and web pages. One of the reasons for its popularity is the ease with which a user can run it. If you still don't know how, here we show you step by step.
What is PHP?
Hypertext Preprocessor where PHP is a server-side scripting programming language. It is used to create apps and websites.
Although implemented for several years, it is even used to create elaborate websites such as online stores or mobile apps. PHP files end with the .php extension , as a name.
How to open a PHP file?
With Notepad: To view and edit the contents of a PHP file, you can access it from text-based applications such as Notepad.
- Select the .php file
- Right click on it and choose the option Open with
- From the list of available applications, choose notepad
You can now see all the code on the page and even edit it. The downside of opening it with this application is that the code elements are not identified by color and this makes it more difficult to read.
BBE says: if you are a native iOS user, the app you can use to read the file is BBEdit.
- Run the app BBEdit
- Click on the menu File / Open
- Select the file in the folder where it is
NotePad++: An application for free and very light compatible with several programming languages. It's a plain text editor, but focused on programming, so editing the code is easier.
Paiza.IO: He is an editor and compiler in well known line . Write code in PHP directly on the platform or download it to compile it and verify that it works.
How to run a PHP file?
PHP files can be executed from a web server like ISS and Apache . Another usual way to do this is to utiliser the console in using command lines.
One of the commonly used applications is Compose. It works as a dependency manager to import or export databases, clear the cache or install applications.
However, the most used medium is through servers. It doesn't have to be a paid service, there are app packages like XAMPP which are used for local testing.
XAMPP
It works like a Web server and allows developers to test applications before releasing them to an open environment. It's free and easy to install.
- Download the application , it is available for Windows, Linux and OS X
- Follow the installation process
- Run the app for the first time and wait for the icon turn green
- Check that all services such that Apache and MySQL start
- Place the PHP files in the folder htdocs dossier XAMPP on your hard drive
- Open your preferred browser and type in the address bar localhost
- The PHP files you have installed are displayed, click on the one you want to run to test its operation
DCM
To run a file from CMD, you must have a previous installation of XAMPP or WAMP. Remember to start Application Services before running the file.
- Place the .php files in the local server folder
- Enter the control panel
- Click on System / System and security / Advanced system settings
- Appuyez on the button Environment variables
- Choose the variable PATH and click on Edit
- Put a semicolon (;) at the end of the path
- Click OK and close all windows
- Open the Run window with the shortcut command Win + R and type CMD
- In the console window, write the way and the name of the PHP file you want to run