SQLite3::loadExtension
(PHP 5 >= 5.3.0)
SQLite3::loadExtension — Attempts to load an SQLite extension library
Описание
public bool SQLite3::loadExtension
( string
$shared_library
)Attempts to load an SQLite extension library.
Список параметров
-
shared_library
-
The name of the library to load. The library must be located in the directory specified in the configure option sqlite3.extension_dir.
Возвращаемые значения
Returns TRUE
if the extension is successfully loaded, FALSE
on failure.
Примеры
Пример #1 SQLite3::loadExtension() example
<?php
$db = new SQLite3('mysqlitedb.db');
$db->loadExtension('libagg.so');
?>
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с базами данных
- Расширения для работы с базами данных отдельных производителей
- SQLite3
- Функция SQLite3::busyTimeout() - Sets the busy connection handler
- SQLite3::changes
- Функция SQLite3::close() - Closes the database connection
- Функция SQLite3::__construct() - Instantiates an SQLite3 object and opens an SQLite 3 database
- Функция SQLite3::createAggregate() - Registers a PHP function for use as an SQL aggregate function
- Функция SQLite3::createCollation() - Registers a PHP function for use as an SQL collating function
- Функция SQLite3::createFunction() - Registers a PHP function for use as an SQL scalar function
- SQLite3::enableExceptions
- Функция SQLite3::escapeString() - Returns a string that has been properly escaped
- Функция SQLite3::exec() - Executes a result-less query against a given database
- Функция SQLite3::lastErrorCode() - Returns the numeric result code of the most recent failed SQLite request
- Функция SQLite3::lastErrorMsg() - Returns English text describing the most recent failed SQLite request
- Функция SQLite3::lastInsertRowID() - Returns the row ID of the most recent INSERT into the database
- Функция SQLite3::loadExtension() - Attempts to load an SQLite extension library
- Функция SQLite3::open() - Opens an SQLite database
- SQLite3::openBlob
- Функция SQLite3::prepare() - Подготавливает SQL-запрос для выполнения
- Функция SQLite3::query() - Выполняет SQL-запрос
- Функция SQLite3::querySingle() - Executes a query and returns a single result
- Функция SQLite3::version() - Returns the SQLite3 library version as a string constant and as a number
Коментарии
For newbies like me: if loadExtension fails with "Not supported in multithreaded Web servers" message (which always happens on IIS and sometimes - on Apache), you need to use non-thread-safe build of PHP, which is not always a bad idea; see https://www.geeksforgeeks.org/what-is-thread-safe-or-non-thread-safe-in-php/
One more addition. If you need to setup non-thread-safe PHP on XAMPP/Apache to use loadextension, look at this article: https://paulshipley.id.au/blog/coding-tips/improve-php-performance-with-fastcgi-on-xampp-for-windows/
Tl;dr - you need to install&configure mod_fcgid module for Apache.