欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php的dl函数_PHP教程

程序员文章站 2022-05-17 08:42:58
...
http://www.php.net/manual/en/function.dl.php

// 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);

}

?>

dl("memcache.so");

这样只要php.ini中配置好就可以不要再引用so文件不然会说多处引用

extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"

;extension=memcache.so

作者 21aspnet

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/478547.htmlTechArticlehttp://www.php.net/manual/en/function.dl.php ?php // Example loading an extension based on OS if (!extension_loaded(sqlite)) { if (strtoupper(substr(PHP_OS, 0, 3)) === WIN) { dl(ph...