dongtun1683 2010-02-16 17:00 采纳率: 0%
浏览 38
已采纳

PHP gettext扩展在我的本地主机上工作,但它不能在我的主机上工作

I tried php gettext in my localhost and everything worked, but when I uploaded the files to my hosting it said the following:

Warning: putenv(): Safe Mode warning: Cannot set environment variable 'LC_ALL' - it's not in the allowed list in /www/zxq.net/w/e/e/weedcl/htdocs/localization.php on line 4 Fatal error: Call to undefined function bindtextdomain() in /www/zxq.net/w/e/e/weedcl/htdocs/localization.php on line 6

I'm using the free hosting service Zymic (Does it have to do with the fact that its FREE?).

My localization.php:

<?php
$locale = "de_DE";
if (isSet($_GET["locale"])) $locale = $_GET["locale"];
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
bind_textdomain_codeset("messages", 'UTF-8');
textdomain("messages");
?>
  • 写回答

2条回答 默认 最新

  • duanmu8911 2010-02-16 17:08
    关注

    I'm using the free hosting service Zymic (Does it have to do with the fact that its FREE?).

    Probably. It has safe_mode enabled and you can't change the LC_ALL environment variable. You will run into these kind of problems on every host that has safe_mode enabled, and most free ones have it that way.

    Try to remove the putenv() call and see what happens then.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 Oracle触发器记录修改前后的字段值
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器