PHP 5.5不正确加载getText



我遇到了一个问题,即getText在Windows 7上无法使用PHP 5.5.5.8 VC11 X86和Apache 2.4。我在php.ini中启用了它,并根据需要安装gnu getText。当我调用phpinfo()函数时,GetText似乎也没有显示出来,并且仍引起WSOD并在我的Apache日志中丢弃错误:

[:error] [pid 4372:tid 784] [client ::1:60968] PHP Fatal error: Call to undefined function _() in <directory/file/etc.>

[:error] [pid 4372:tid 784] [client ::1:61771] PHP Fatal error: Call to undefined function bindtextdomain() in <directory/file/etc.>

然而,我知道它是从phpinfo()函数的输出中读取正确的php.ini文件,并且PDO和OPENSL的功能正常工作。我一直在寻找过去2个小时的解决方案,并且已经干了。

我正在尝试使用的代码并继续在启用GetText的XAMPP安装中完美工作,因此我确实知道这不是我正在尝试的代码。(不,只有Apache 2.4服务器正在运行。因此,那里没有冲突。)

修复了它,这是:

phpinfo()函数开始将垃圾扔进apache/logs/errors.txt如下...

PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_gettext.dll' - The specified module could not be found.rn in Unknown on line 0

PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_openssl.dll' - The specified module could not be found.rn in Unknown on line 0

PHP Warning: PHP Startup: Unable to load dynamic library 'ext\php_pdo_mysql.dll' - The specified module could not be found.rn in Unknown on line 0

和phpinfo()表明,当它从php/ext加载dll时,默认路径为c: windows。因此,我按照以下建议更改了系统的环境变量:

http://bytes.com/topic/php/answers/510919-php-looking-php-ini-file-file-c-windows

开始 ->(右键单击)我的计算机 ->属性 ->高级选项卡 ->环境变量按钮

在"系统变量"下,您会找到"路径"的变量。在现有数据之后,您需要在其中的php.ini文件中添加路径,例如:;c:php (您需要;与以前的值分开。)

更改该值后,您需要重新启动窗口,以便添加的环境变量生效,并可以在启动时挂接到Apache/php中。

最新更新