PHP

HOW TO RUN PHP SCRIPTS (CLI & SAPI)

SERVER API The more commonly known way to run PHP script, set to run alongside a web server (generally Apache or IIS).

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 SERVER API

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 terminal and run PHP PATH/YOUR-SCRIPT.PHP