PHP: Hypertext Preprocessor (original) (raw)

`When working with FFI under a PHP ZTS environment, there is no standard way to change the directory with libraries (dll/so/dylib/etc), so to get around this problem, you should use something like this polyfill:

SetDllDirectoryA($directory) ; break; case 'Linux': case 'BSD': \FFI::cdef('int setenv(const char *name, const char *value, int overwrite);') ->setenv('LD_LIBRARY_PATH', $directory, 1) ; break; case 'Darwin': \FFI::cdef('int setenv(const char *name, const char *value, int overwrite);') ->setenv('DYLD_LIBRARY_PATH', $directory, 1) ; break; }?>

`