How to Install PHP Extensions on Windows?
PHP is a general-purpose server scripting language. It is a powerful and important tool for developing dynamic and interactive Web pages. It is widely used, free, fast, flexible, and pragmatic. After installing PHP and a web server on Windows, extensions are also needed because they provide added functionality. PHP with extensions is the best combination for the developers to develop more dynamic and interactive web pages or applications. Extensions can be chosen when PHP starts by modifying your php.ini.
There are so many extensions are built into the Windows version of PHP. To load more extensions you require .dll files in your system. An extension directive or extra DLL does not require loading these extensions. There are many ways to install extensions, the following is one of the ways to install php extensions on Windows.
Prerequisites: Web server(e.g. Apache, XAMPP).
Verifying the extension is installed or not
To verify the extension is installed or not you have to follow the following step:
Step 1: Create a new file in the root directory with an extension.php like findingexten.php. In this file write the following code:
// It will return all the configurations of the server
Step 2: Run this file in any browser and you will see the given extension is installed or not.
Installing PHP Extensions on Windows
To install PHP extension we need to follow the following steps:
Step 1: Click on the Config button then select the php.ini file for your PHP installation, and open it in a text editor.
Step 2: Locate the line that specifies the location of the “extension = ” line.
Step 3: Look for the extension you want to install and remove the semicolon preceding that line. For example, if you want to install an IMAP extension, remove the semicolon of the following line and save the file.
;extension = imap
extension = imap
Step 4: Go to ‘php’ folder in the C:\xampp
Step 5: Go to the ext folder and locate the .dll file of the extension you want to install.
Step 6: Now copy the .dll file and paste it into the following folder:
Step 7: Now restart XAMPP to see the effects.