Load extension dll php

Установка расширений PHP в ОС Windows

После установки PHP и веб-сервера на ОС Windows может понадобиться установить некоторые расширения для добавления функционала. Вы можете выбрать, какие расширения будут загружаться при старте PHP, модификацией вашего файла php.ini . Также вы можете загружать расширения динамически в ваших скриптах, используя функцию dl() .

Библиотеки DLL расширений PHP имеют префикс php_.

Многие расширения встроены в Windows-версию PHP. Это значит, что дополнительные DLL-файлы и директива extension не используются для загрузки данных расширений. Таблица расширений PHP в Windows, содержащая список расширений, требующих (или обычно требующих) дополнительные DLL-файлы. Ниже приведен список встроенных расширений (обновлено PHP 5.0.4): BCMath, Caledar, COM, Ctype, DOM, FTP, LibXML, Iconv, ODBC, PCRE, Session, SimpleXML, SPL, SQLite, WDDX, XML и Zlib.

    измените опцию extension_dir так, чтобы она указывала на директорию, в которой расположены расширения или в которую вы поместили файлы php_*.dll . Например:

extension_dir = C:\php\extensions
// измените следующую строку с . ;extension=php_bz2.dll // . на extension=php_bz2.dll

Замечание: Если вы запустили PHP в качестве модуля сервера, не забудьте перезагрузить веб-сервер для применения ваших изменений в файле php.ini .

Следующая таблица описывает некоторые доступные расширения и требуемые дополнительные библиотеки dll.

Расширения PHP
Расширение Описание Примечания
php_bz2.dll Функции сжатия bzip2
php_calendar.dll Функции преобразования календарей
php_crack.dll Функции Crack
php_ctype.dll Семейство функций ctype
php_curl.dll Функции библиотеки CURL Требует библиотеки libeay32.dll , ssleay32.dll (в комплекте дистрибутива PHP)
php_dba.dll DBA: функции абстрактного слоя DataBase (dbm-стиль)
php_dbase.dll Функции dBase
php_dbx.dll Функции dbx
php_exif.dll Функции EXIF Требуется библиотека php_mbstring.dll. Библиотека php_exif.dll должна загружаться после php_mbstring.dll в файле php.ini .
php_fbsql.dll Функции FrontBase
php_fdf.dll FDF: функции формата данных «Forms Data Format» Требуется библиотека fdftk.dll (в комплекте дистрибутива PHP)
php_filepro.dll Функции filePro Доступ только для чтения
php_ftp.dll Функции FTP
php_gd2.dll Библиотека функций обработки изображений GD GD2
php_gettext.dll Функции Gettext В PHP версий = 4.2.3 требуется библиотека libintl-1.dll и iconv.dll (в комплекте дистрибутива PHP).
php_hyperwave.dll Функции HyperWave
php_iconv.dll Функции конвертации кодировок ICONV Требуется библиотека iconv-1.3.dll (в комплекте дистрибутива PHP), iconv.dll
php_ifx.dll Функции Informix Требуются библиотеки Informix
php_iisfunc.dll Функции управления IIS
php_imap.dll Функции IMAP POP3 и NNTP
php_ingres.dll Функции Ingres Требуются библиотеки Ingres
php_interbase.dll Функции InterBase Требуется библиотека gds32.dll (в комплекте дистрибутива PHP)
php_ldap.dll Функции LDAP Требует libeay32.dll , ssleay32.dll (в комплекте дистрибутива PHP)
php_mbstring.dll Функции для работы с многобайтовыми (Multi-Byte) строками
php_mcrypt.dll Функции кодирования Mcrypt Требуется библиотека libmcrypt.dll
php_mhash.dll Функции Mhash Требуется библиотека libmhash.dll (в комплекте дистрибутива PHP)
php_mime_magic.dll Функции Mimetype Требуется файл magic.mime (в комплекте дистрибутива PHP)
php_ming.dll Функции Ming для Flash
php_msql.dll Функции mSQL Требуется библиотека msql.dll (в комплекте дистрибутива PHP)
php_mssql.dll Функции MSSQL Требуется библиотека ntwdblib.dll (в комплекте дистрибутива PHP)
php_mysql.dll Функции MySQL Требуется библиотека libmysql.dll (в комплекте дистрибутива PHP)
php_mysqli.dll Функции MySQLi Требуется библиотека libmysql.dll ( libmysqli.dll в PHP версий
php_oci8.dll Функции Oracle 8 Требуются клиентские библиотеки Oracle 8.1+
php_openssl.dll Функции OpenSSL Требуется библиотека libeay32.dll (в комплекте дистрибутива PHP)
php_pdf.dll Функции PDF
php_pgsql.dll Функции PostgreSQL
php_shmop.dll Функции для работы с разделяемой памятью
php_snmp.dll Функции для использования протокола SNMP Только на Windows NT!
php_soap.dll Функции SOAP
php_sockets.dll Функции для работы с сокетами
php_sybase_ct.dll Функции Sybase Требуются клиентские библиотеки Sybase
php_tidy.dll Функции Tidy
php_tokenizer.dll Функции Tokenizer
php_w32api.dll Функции W32api
php_xmlrpc.dll Функции XML-RPC Требуется библиотека iconv.dll (в комплекте дистрибутива PHP)
php_xslt.dll Функции XSLT Требуются библиотеки sablot.dll , expat.dll , iconv.dll (в комплекте дистрибутива PHP).
php_yaz.dll Функции YAZ Требуется библиотека yaz.dll (в комплекте дистрибутива PHP)
php_zip.dll Функции для работы с файлами Zip Доступ только для чтения
php_zlib.dll Функции сжатия ZLib

Источник

Load extension dll php

dl — Loads a PHP extension at runtime

Описание

Loads the PHP extension given by the parameter library.

Use extension_loaded() to test whether a given extension is already available or not. This works on both built-in extensions and dynamically loaded ones (either through php.ini or dl() ).

This function has been removed from some SAPI’s in PHP 5.3.

Список параметров

This parameter is only the filename of the extension to load which also depends on your platform. For example, the sockets extension (if compiled as a shared module, not the default!) would be called sockets.so on Unix platforms whereas it is called php_sockets.dll on the Windows platform.

The directory where the extension is loaded from depends on your platform:

Windows — If not explicitly set in the php.ini , the extension is loaded from C:\php4\extensions\ (PHP4) or C:\php5\ (PHP5) by default.

  • whether PHP has been built with —enable-debug or not
  • whether PHP has been built with (experimental) ZTS (Zend Thread Safety) support or not
  • the current internal ZEND_MODULE_API_NO (Zend internal module API number, which is basically the date on which a major module API change happened, e.g. 20010901)

Возвращаемые значения

Возвращает TRUE в случае успешного завершения или FALSE в случае возникновения ошибки. If the functionality of loading modules is not available or has been disabled (either by setting enable_dl off or by enabling безопасный режим in php.ini ) an E_ERROR is emitted and execution is stopped. If dl() fails because the specified library couldn’t be loaded, in addition to FALSE an E_WARNING message is emitted.

Примеры

Пример #1 dl() examples

// Example loading an extension based on OS
if (! extension_loaded ( ‘sqlite’ )) if ( strtoupper ( substr ( PHP_OS , 0 , 3 )) === ‘WIN’ ) dl ( ‘php_sqlite.dll’ );
> else dl ( ‘sqlite.so’ );
>
>

// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
if (! extension_loaded ( ‘sqlite’ )) $prefix = ( PHP_SHLIB_SUFFIX === ‘dll’ ) ? ‘php_’ : » ;
dl ( $prefix . ‘sqlite.’ . PHP_SHLIB_SUFFIX );
>
?>

Список изменений

Версия Описание
5.3.0 dl() is now disabled in some SAPI’s due to stability issues. The only SAPI’s that allow dl() are: CLI, CGI and Embed. Use the Extension Loading Directives instead.

Примечания

Замечание:

dl() is not supported when PHP is built with ZTS support. Use the Extension Loading Directives instead.

Замечание:

dl() is case sensitive on Unix platforms.

Смотрите также

Источник

Load extension dll php

On Windows, you have two ways to load a PHP extension: either compile it into PHP, or load the DLL. Loading a pre-compiled extension is the easiest and preferred way.

To load an extension, you need to have it available as a «.dll» file on your system. All the extensions are automatically and periodically compiled by the PHP Group (see next section for the download).

To compile an extension into PHP, please refer to building from source documentation.

To compile a standalone extension (aka a DLL file), please refer to building from source documentation. If the DLL file is available neither with your PHP distribution nor in PECL, you may have to compile it before you can start using the extension.

Where to find an extension?

PHP extensions are usually called «php_*.dll» (where the star represents the name of the extension) and they are located under the «PHP\ext» folder.

PHP ships with the extensions most useful to the majority of developers. They are called «core» extensions.

However, if you need functionality not provided by any core extension, you may still be able to find one in » PECL. The PHP Extension Community Library (PECL) is a repository for PHP Extensions, providing a directory of all known extensions and hosting facilities for downloading and development of PHP extensions.

If you have developed an extension for your own uses, you might want to think about hosting it on PECL so that others with the same needs can benefit from your time. A nice side effect is that you give them a good chance to give you feedback, (hopefully) thanks, bug reports and even fixes/patches. Before you submit your extension for hosting on PECL, please read » PECL submit.

Which extension to download?

  • Different version numbers (at least the first two numbers should match)
  • Different thread safety settings
  • Different processor architecture (x86, x64, . )
  • Different debugging settings
  • etc.

You should keep in mind that your extension settings should match all the settings of the PHP executable you are using. The following PHP script will tell you all about your PHP settings:

Example #1 phpinfo() call

Or from the command line, run:

Источник

Loading or identifying extension directory of dll in windows

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.

GD support is loaded "; >else< echo "
GD support is NOT loaded "; > ?>

Источник

Читайте также:  Вывести html документ 1с
Оцените статью