开发者

Is there a sequence of loading of extensions/modules in PHP?

开发者 https://www.devze.com 2023-02-17 04:34 出处:网络
We installed the PHP extension for memcached server http:开发者_开发技巧//pecl.php.net/package/memcached

We installed the PHP extension for memcached server http:开发者_开发技巧//pecl.php.net/package/memcached using pecl install memcached which ended with an instruction to add "extension=memcached.so" in the php.ini, while we did that, we kept getting the error http://pecl.php.net/bugs/bug.php?id=17574&edit=1.

So we removed that line "extension=memcached.so" from php.ini and added this line to the file /etc/php.d/memcached.ini and every thing worked fine.

leaves me with a question.. is there a specific sequence in which PHP loads the extension/modules, and how will the sequence matter any ways??


When extensions are loaded externally like they are with the 'memchached.ini' version, they tend to be loaded in alphabetical order. So if json's being loaded externally as well, 'j' comes before 'm' and things work as expected. if you're specifying them in the php.ini directly, they're loaded in parse order - the order specified in the file.

There's a spot in the PHP.ini where it's told to look for external modules. If you'd put the memcached stuff after that line, then everything most likely would have been fine.

0

精彩评论

暂无评论...
验证码 换一张
取 消