PHP

HOW TO RUN PHP SCRIPTS

a step-by-step guide

WEB SERVER The more commonly known way to run PHP scripts. Create a PHP website and run alongside a web server (Apache, IIS, NGINX).

COMMAND LINE The so-called "alternative" way run PHP scripts, "independently by itself", without a web server.

TWO WAYS TO RUN PHP

01

2. Create PHP scripts in the /XAMPP/htdocs/ folder.

3. Launch the XAMPP control panel, start Apache and MySQL.

4. Open web browser and access http://localhost/YOUR-SCRIPT.PHP

RUN PHP IN WEB SERVER

02

RUN PHP IN COMMAND LINE

03

2. Create PHP scripts in your project folder.

3. Launch the XAMPP control panel, start MySQL if required.

4. Open command line and run PHP PATH/YOUR-SCRIPT.PHP