extension_dir - Module Library Location

This section describes the extension_dir configuration setting specifying the directory where module library files are located.

If a module is not bundled with the PHP core binary code, it needs to be compiled into a library (.dll or .so) file. In order to load the library file, it needs to be placed in a directory specified in the extension_dir configuration setting.

You can use the "php i" command to find the current extension_dir setting:

herong$ php -i | grep extension_dir

extension_dir => /usr/lib/php/20170718 => /usr/lib/php/20170718

Here is what I have in the extension_dir directory on my Ubuntu computer. They are module library files not bundled with the PHP core binary code.

herong$ ls -l /usr/lib/php/20170718

-rw-r--r-- 1 root root   31952 Feb 23  2023 calendar.so
-rw-r--r-- 1 root root   14440 Feb 23  2023 ctype.so
-rw-r--r-- 1 root root   84072 Feb 23  2023 exif.so
-rw-r--r-- 1 root root 5044744 Feb 23  2023 fileinfo.so
-rw-r--r-- 1 root root   59496 Feb 23  2023 ftp.so
-rw-r--r-- 1 root root   14440 Feb 23  2023 gettext.so
-rw-r--r-- 1 root root   43176 Feb 23  2023 iconv.so
-rw-r--r-- 1 root root   43112 Feb 23  2023 json.so
-rw-r--r-- 1 root root  445152 Feb 23  2023 opcache.so
-rw-r--r-- 1 root root  113048 Feb 23  2023 pdo.so
-rw-r--r-- 1 root root  272912 Feb 23  2023 phar.so
-rw-r--r-- 1 root root   35112 Feb 23  2023 posix.so
-rw-r--r-- 1 root root   30824 Feb 23  2023 readline.so
-rw-r--r-- 1 root root   14440 Feb 23  2023 shmop.so
-rw-r--r-- 1 root root   88168 Feb 23  2023 sockets.so
-rw-r--r-- 1 root root   18536 Feb 23  2023 sysvmsg.so
-rw-r--r-- 1 root root   10344 Feb 23  2023 sysvsem.so
-rw-r--r-- 1 root root   14440 Feb 23  2023 sysvshm.so
-rw-r--r-- 1 root root   18536 Feb 23  2023 tokenizer.so

Table of Contents

 About This Book

 Introduction and Installation of PHP

 Managing PHP Environment and Modules on macOS

 Managing PHP Environment and Modules on CentOS

Configuration and Modules

 Manage Runtime Configuration Directives

 "php -i" - Display Configuration Information

 php.ini - Configuration Directive File

 Additional .ini Configuration Files

 Load PHP Extensions/Modules

extension_dir - Module Library Location

 "php -m" - Display Loaded Modules

 get_extension_funcs() - Get Module Functions

 dl() - Load Module Dynamically

 cURL Module - Client for URL

 DOM Module - Parsing HTML Documents

 GD Module - Manipulating Images and Pictures

 MySQLi Module - Accessing MySQL Server

 OpenSSL Module - Cryptography and SSL/TLS Toolkit

 PCRE Module - Perl Compatible Regular Expressions

 SOAP Module - Creating and Calling Web Services

 SOAP Module - Server Functions and Examples

 Zip Module - Managing ZIP Archive Files

 References

 Index

 Full Version in PDF/EPUB