I dont want to jump into everything as I'm about to leave work, I would just like suggestions or things to change. I have a centos linux server and this is the code that's giving me the error and i'm not sure whats wrong since I downloaded it like this and it wont work.

if (!extension_loaded('librets')) {
  if (strtolower(substr(PHP_OS, 0, 3)) === 'win') {
    if (!dl('php_librets.dll')) return;
  } else {
    // PHP_SHLIB_SUFFIX gives 'dylib' on MacOS X but modules are 'so'.
    if (PHP_SHLIB_SUFFIX === 'dylib') {
      if (!dl('librets.so')) return;
    } else {
      if (!dl('librets.'.PHP_SHLIB_SUFFIX)) return;
    }
  }
}

I get the following error:

Fatal error: Call to undefined function dl() in /home/removed/public_html/test/rets2/librets.php on line 22

I'm not sure whats wrong..

Anyone?

有帮助吗?

解决方案

dl is not a good solution for loading libraries under certain conditions, which is why the function has been removed from several of the SAPI-s (Server APIs - the connection between PHP and the server running PHP). You'll either have to add it to php.ini or load it through whatever means your server has available for that. If you're on shared hosting, the hoster may also have disabled dl() for security reasons.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top