Loading or identifying extension directory of dll in windows

phpinfo() output for sqlite3 support3
PHP stores all the dlls inside the extension directory in window system. The dlls are loaded from here ( the directory ) based on the setting of php.ini file. Many times one can get the error message saying extension not found. So after installation of PHP the best way to identify the extension directory is to open php info file and check for all the settings.

In the php info display it will be written where the extension file of the system is stored. It is also known as extension_dir . The picture below is the screen shoot of the php info display and the portion explaining the extension directory is shown.
The php.ini file located inside windows folder ( or inside php folder ) can be edited to change the extension directory location. The location of php.ini file also can be collected from php info display. Inside the php.ini file there is a line saying like this.
; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:\php_new\ext"
Change the above line to point to correct extension directory path. After showing the path inside php.ini file below the above line there will be all dlls listing and any dll can be added or removed by commenting or removing the comment before it. Here is some listing examples.
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll

;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
You can see three .dlls are in use. The comments lines are removed. This is the way we add or remove extensions for PHP.

Checking extension loaded or not

We can check the status of the extension by using extension_loaded() function. Here is a sample code to check gd extension.
<?Php
if (extension_loaded('gd')) {
echo "<br>GD support is  loaded ";
}else{
echo "<br>GD support is NOT loaded ";
}
?>
Note that these all are in window platform.
ini_loaded_file():Path of php.ini file Collect all PHP settings by phpinfo()
Introduction to PHP
Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com







    Vaijanath

    18-07-2014

    What about Linux systems? I'm using LAMP. Working on linux mint os and apache web server. How to enable gd support in Lamp?

    Post your comments , suggestion , error , requirements etc here





    PHP video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer