简体   繁体   中英

PHP refuses to load shared extensions on Mac OS X

I have a PHP extension ( APC ) which I've built using PECL. I've added it to the config file by adding this :

extension=/usr/lib/php/extensions/no-debug-non-zts-20090626/apc.so

However PHP ignores the extension completely, without any errors or anything. Why does that happen?

My PHP configure command:

'./configure' \\ '--with-apxs2' \\ '--enable-gd-native-ttf' \\ '--with-curl' \\ '--with-gd' \\ '--with-freetype-dir=/opt/X11/' \\ '--with-jpeg-dir=/opt/local/' \\ '--with-png-dir=/opt/local/' \\ '--with-mysql=/usr/local/mysql' \\ '--without-iconv' \\ '--with-mm' \\ '--with-mysqli=/usr/local/mysql/bin/mysql_config' \\ '--with-imagick=/opt/local/' \\ '--enable-mbstring' \\ '--with-libmemcached-dir=/opt/local' \\ '--enable-memcached' \\ "$@"

PS Same thing happened with memcached extension, so I've statically linked it into PHP. I can't do that with APC because it causes linking errors when I link it into PHP, so I have to build it as a shared extension.

PS2: The extension_dir way doesn't work either.

Are you sure you're actually getting the php.ini you think you are, not one elsewhere (like the default OS X php config). Does phpinfo() show anything interesting?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM