奇忠诚 发表于 2018-12-22 08:44:44

在linux下,为php增加mbstring扩展

  由于是客户的服务器没有安装mbstring扩展,不能重新编译、安装,所以只能添加mbstring这个扩展,网上查找了很多,多数都是以下方法(php版本5.1.6,安装目录/usr/local/php,源代码目录/usr/software/php5.1.6):
  1、用cd命令进入php的源代码目录下的etc/mbstring目录下,即“/usr/software/php5.1.6/etc/mbstring”;
  2、执行
  #/usr/local/php/bin/phpize
  3、执行
  #./configure --with-php-config=/usr/local/php/bin/php-config
  4、执行make && make install
  5、之后系统提示mbstring.so文件所在的目录。根据php.ini中指示的extension_dir指向的目录中,将其复制过去
  6、修改php.ini,添加一句extension=mbstring.so
  如果运行phpMyAdmin发现如下错误:
  The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results.
  是因为没有mbstring扩展所致,解决方法如下
  在SSH登录LINUX后执行以下命令:
  1.执行
  yum install php-mbstring
  2. 修改php.ini (这一步非常重要, 部分lxadmin版本无法自动修改)
  echo ‘extension=mbstring.so’ >>/usr/local/lxlabs/ext/php/etc/php.ini
  3. 重启web service
  如果是apache: service httpd restart
  如果是lighttpd: service lighttpd restart
  4. 安装成功

页: [1]
查看完整版本: 在linux下,为php增加mbstring扩展