PHP Installation
To install PHP, follow these general steps depending on your operating system:
Windows Installation
Using XAMPP (Recommended for beginners):
-
Download XAMPP from: https://www.apachefriends.org/
-
Run the installer and select Apache and PHP components.
-
Launch the XAMPP Control Panel and start Apache.
-
Place your PHP files in the
htdocs
folder inside the XAMPP directory. -
Access your PHP files in a browser at:
http://localhost/filename.php
Manual PHP Installation (Advanced):
-
Download PHP from: https://windows.php.net/download/
-
Extract the files to
C:\php
-
Add
C:\php
to the Windows PATH variable. -
Configure
php.ini
(copy and renamephp.ini-development
tophp.ini
) -
Optionally configure Apache or use PHP’s built-in server:
Linux Installation (Ubuntu/Debian)
-
Check version:
-
To run a file:
macOS Installation
Using Homebrew:
-
Install Homebrew if you haven’t:
-
Install PHP:
-
Check version:
-
Start PHP’s built-in server:
Would you like help verifying the installation or setting up a devel