欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

Fatal error: Call to undefined function locale_get_default()

I get this error:

Fatal error: Call to undefined function locale_get_default() on linux hosting (cpanel). The PHP Version is 5.3

I use this to detect users location and language

Here PHP documentation and it has a sample code

http://php.net/manual/en/locale.getdefault.php

I had same issue in localhost using xampp and got it resolved using this post locale_get_default() function issue on localhost

But in web hosting i get the same error

Ask Question

I get this error:

Fatal error: Call to undefined function locale_get_default() on linux hosting (cpanel). The PHP Version is 5.3

I use this to detect users location and language

Here PHP documentation and it has a sample code

http://php.net/manual/en/locale.getdefault.php

I had same issue in localhost using xampp and got it resolved using this post locale_get_default() function issue on localhost

But in web hosting i get the same error

shareimprove this question
 
   
What version of linux? cpanel? etc – Zarathuztra Dec 13 '13 at 14:27
1 
So... find this function. It's not a standard PHP one, so we can't help you - we have no idea what you're doing with this function. – Marc B Dec 13 '13 at 14:36
   
@user689 SO is kind of the google of technical answers so...yeah... – Zarathuztra Dec 13 '13 at 14:41
正确答案 

This function requires PECL intl >= 1.0.0... check this;

http://php.undmedlibrary.org/manual/en/function.locale-get-default.php

Check if it installed. If not, ask your hosting provider to install it.

shareimprove this answer
 
   
hosting provided says they won't be able to install php_intl() extension since its a shared hosting. Thanks. – Shumaise Mohammed Dec 15 '13 at 15:10

来自  https://stackoverflow.com/questions/20568853/fatal-error-call-to-undefined-function-locale-get-default



 

Im using wampserver on localhost with;

  • PHP 5.3.13
  • Apache 2.2.22
  • Enabled php_intl.dll extension

But i got following error while using locale_get_default() function

Fatal error: Call to undefined function locale_get_default() in

Or using Locale::getDefault() function

Fatal error: Class 'Locale' not found in

shareimprove this question
 
正确答案 

snip didnt read:

Are you sure the extension is loaded? (See phpinfo();)

shareimprove this answer
 
   
I couldnt see in phpinfo but i was enabled from settings and checked in php.ini file. Because of what? – BoraDec 11 '13 at 13:36
   
If it does not show as loaded in phpinfo(); it is not loaded hence the undefined function error. Are you sure the .dll is the proper version for the used PHP version? – Ronald Swets Dec 11 '13 at 13:45
   
I solved with following link: forum.wampserver.com/read.php?2,80704,116793 thanks – Bora Dec 11 '13 at 14:26

Solved with Following Link

http://forum.wampserver.com/read.php?2,80704,116793

Ok, I got it to work. It looks like Apache can't find the icu*.dll files (in the php directory).

So, one solution is to add "C:\wamp\bin\php\php5.3.9" (or similar directory) to your system PATH.

The other solution is to copy the icu*.dll files to your apache's bin directory.

A third option is to copy the icu*.dll files to your Windows system directory (system32 or SysWOW64).

shareimprove this answer
 
   
The best solution is to copy the icu files into the Apache folder. Of course when you switch PHP or Apache version you need to make sure you do it again. If you copy them to system32 or add a folder to the path it is less flexible, and you may end up with the wrong files being pointed to. – RiggsFolly Dec 12 '13 at 23:48

来自  https://stackoverflow.com/questions/20520026/locale-get-default-function-issue-on-localhost



无法加载动态库'... / ext / php_intl.dll' - 无法找到模块!!!
发表于: Don_X (---.135-160-184.mc.videotron.ca)
日期:2012年1月21日03:09 PM

你好,
在启动时,我不断得到以下的msg:无法加载动态库,'.... / php_intl.dll,

其次是: - 找不到指定的模块!

虽然模块在那里

我使用WAMPServer 2.2与PHP 5.3.8和Apache 2.2.21 

搜索网络后,我已经尝试了许多建议

在我的php.ini文件,我已经做了建议,通过添加extension = php_intl .dll 

,我仍然在启动时得到相同的msg!

请帮忙 !
选项: 回复 • 报价
Re:无法加载动态库'... / ext / php_intl.dll' - 无法找到模块!!!
发布者: showstopper (186.44.209 .---)
日期:2012年1月22日下午11:53

Befor你可以添加extension = php_intl.dll我相信你需要设置扩展目录在php.ini或你可以使用extension = c:/ wamp / path / to / php扩展名dir / php_intl.dll 

Fitcom - 技术和SEO具有极佳的一面

在Windows 7和8中安装和配置WAMP服务器
选项: 回复 • 报价
Re:无法加载动态库'... / ext / php_intl.dll' - 无法找到模块!!!
发表于: Don_X (---.135-160-184.mc.videotron.ca)
日期:2012年1月24日05:00 AM

你有什么其他的建议吗?... 任何人都可以帮助或协助...这真的很讨厌!谢谢

来自  http://forum.wampserver.com/read.php?2,80704,116793

普通分类: