php-fpm不会在Gentoo上加载mbstring模块

时间:2013-04-24 09:59:52

标签: php gentoo mbstring

我是Gentoo的新手,我在emerge安装了nginx \ php \ fastcgi。之后,我运行phpinfo()并发现没有mbstring,然后我通过set USE=unicode编译它。然后我在php.ini中看到了[mbstring],我通过kill进程重新启动了php-fpm并运行/etc/init.d/php-fpm -R,但仍然没有mbstring模块。

然后我检查/etc/init.d/php-fpm -m,但也没有。

我现在能做什么?顺便说一下有没有办法重启php-fpm,我不知道为什么没有/etc/init.d/php-fpm restart

仅供参考,我做了find / -name mbstring,它是输出:

/usr/local/src/php-5.4.14/ext/mbstring
/usr/lib64/php5.4/include/php/ext/mbstring

运行# /etc/init.d/php-fpm -h,输出:

Usage: php-fpm [-n] [-e] [-h] [-i] [-m] [-v] [-t] [-p <prefix>] [-g <pid>] [-c <file>] [-d foo[=bar]] [-y <file>] [-D] [-F]
  -c <path>|<file> Look for php.ini file in this directory
  -n               No php.ini file will be used
  -d foo[=bar]     Define INI entry foo with value 'bar'
  -e               Generate extended information for debugger/profiler
  -h               This help
  -i               PHP information
  -m               Show compiled in modules
  -v               Version number
  -p, --prefix <dir>
                   Specify alternative prefix path to FastCGI process manager (default: /usr/local).
  -g, --pid <file>
                   Specify the PID file location.
  -y, --fpm-config <file>
                   Specify alternative path to FastCGI process manager config file.
  -t, --test       Test FPM configuration and exit
  -D, --daemonize  force to run in background, and ignore daemonize option from config file
  -F, --nodaemonize
                   force to stay in foreground, and ignore daemonize option from config file
  -R, --allow-to-run-as-root
                   Allow pool to run as root (disabled by default)

2 个答案:

答案 0 :(得分:0)

确保在编译PHP时使用--enable-mbstring进行编译。

举个例子,这是我的PHP配置,以防它帮助你:

./configure \
--enable-fpm \
--with-fpm-user=apache \
--with-fpm-group=apache \
--enable-sigchild \
--with-libxml-dir=/usr \
--with-openssl=/usr \
--with-kerberos=/usr \
--with-pcre-regex \
--with-zlib=/usr \
--with-zlib-dir=/usr \
--enable-bcmath \
--with-bz2=/usr \
--enable-calendar \
--with-curl=/usr \
--with-libxml-dir=/usr \
--with-enchant=/usr \
--enable-exif \
--with-pcre-dir=/usr \
--enable-ftp \
--with-openssl-dir=/usr \
--with-gd \
--with-vpx-dir=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--with-zlib-dir=/usr \
--with-xpm-dir=/usr \
--with-freetype-dir=/usr \
--with-t1lib=/usr \
--enable-gd-native-ttf \
--enable-gd-jis-conv \
--with-gettext=/usr \
--with-gmp=/usr \
--with-mhash=/usr \
--with-imap=/usr \
--with-kerberos=/usr \
--with-imap-ssl=/usr \
--enable-intl \
--with-icu-dir=/usr \
--enable-mbstring \
--with-onig \
--with-mcrypt=/usr \
--with-mysql \
--with-zlib-dir=/usr \
--with-mysqli=mysqlnd \
--with-pdo-mysql=mysqlnd \
--with-pdo-pgsql=/usr \
--enable-pcntl \
--with-pgsql=/usr \
--with-pspell=/usr \
--enable-shmop \
--with-libxml-dir=/usr \
--with-snmp=/usr \
--with-openssl-dir=/usr \
--enable-soap \
--with-libxml-dir=/usr \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--with-tidy=/usr \
--enable-wddx \
--with-libxml-dir=/usr \
--with-xmlrpc \
--with-libxml-dir=/usr \
--with-iconv-dir=/usr \
--with-xsl=/usr \
--enable-zip \
--with-zlib-dir=/usr \
--with-pcre-dir=/usr \
--enable-mysqlnd \
--with-zlib-dir=/usr \
--with-pear \
--enable-zend-signals

答案 1 :(得分:0)

  1. 检测您的php.ini文件

    php -i | grep php.ini

  2. 向php.ini文件添加扩展名

    extension = mbstring.so;

重新启动php-fpm

systemctl restart php-fpm