[PHP] How to install a PHP extension

7r1n17y

New Member
Jun 11, 2017
13
5
What are PHP extensions?
PHP extensions are compiled libraries that enable certain functions that you can use during your script.

How do i install a PHP extension?
  1. Download the application extension file to copy to your php extensions directory. If you can not locate the extensions directory if you go to your php.ini file and search 'extension_dir' and it will show the complete path to the extension directory. If you can not locate you php.ini file just execute this php code
    PHP:
    <?php echo phpinfo(); ?>
    and look and see what configuration file is being loaded and where it is being loaded. You can download the application extension files from . Just search the packages you want. NOTE: If your using Windows the file will be a .dll file. If you are using Unix it will be a .so file. Also Your extension directory should look similar to mines.
    rsdQEs0UQhSsmw2BwBDq5Q.png
  2. After you have downloaded the application extension and copied it to your extension directory you are gonna add it to your php.ini file so it can be loaded when your PHP terminal fires up. So you are gonna go to your php.ini file and open it and search 'extension' and keep hitting next until you something similar to `extension=php_gettext.dll`, 'extension=php_mysqli.dll', or 'extension=php_curl.dll' and then your gonna type in a new line below the other ones 'extension={filename}.dll' or 'extension={filename}.so' so php can load the extension on startup. Later on if you what to enable/disable an extension just add the semi-colon in front of it so for example ';extension={filename}.dll' is disabled and 'extension={filename}.dll' is enabled. you should be somewhere on the file that looks like.
    7D-XmnkaRTqAuo_qoQJaIA.png
  3. Next just clear the application pools and restart the server so PHP can reload everything including the new extension. Now if you think an extension is not just execute this php code and see if its installed
    PHP:
    <?php print_r(get_loaded_extensions()); ?>
    and it will tell you want extensions got loaded.
If you are having trouble installing an extension please message me.
 
Last edited:

Users who are viewing this thread

Top