{"id":3115,"date":"2014-03-16T20:29:06","date_gmt":"2014-03-16T20:29:06","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/how-to-enable-php-locale-class-collection-of-common-programming-errors\/"},"modified":"2014-03-16T20:29:06","modified_gmt":"2014-03-16T20:29:06","slug":"how-to-enable-php-locale-class-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/how-to-enable-php-locale-class-collection-of-common-programming-errors\/","title":{"rendered":"How to enable PHP Locale class-Collection of common programming errors"},"content":{"rendered":"<p>I am using PHP 5.4.18 and am trying to use the Locale object.<\/p>\n<p>I have tried the following calls:<\/p>\n<pre><code>$locale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n$locale = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n<\/code><\/pre>\n<p>I get the errors &#8216;Call to undefined function&#8217; and &#8216;Class Locale not fund&#8217;, respectively.<\/p>\n<p>I found a mention somewhere that the php_intl extension needs to be enabled. I did this.<\/p>\n<p>I&#8217;ve also looked at the Locale Manual(http:\/\/www.php.net\/manual\/en\/class.locale.php), but there is not mention of needing to enable anything.<\/p>\n<p>What preparation do I need to undergo to enable the Locale class?<\/p>\n<p>Okie. I found that the php_intl file is not loading. However, it is present in the php\/ext directory and the path it shows in the error log is correct.<\/p>\n<p>As a note: I am using WAMP.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am using PHP 5.4.18 and am trying to use the Locale object. I have tried the following calls: $locale = locale_accept_from_http($_SERVER[&#8216;HTTP_ACCEPT_LANGUAGE&#8217;]); $locale = Locale::acceptFromHttp($_SERVER[&#8216;HTTP_ACCEPT_LANGUAGE&#8217;]); I get the errors &#8216;Call to undefined function&#8217; and &#8216;Class Locale not fund&#8217;, respectively. I found a mention somewhere that the php_intl extension needs to be enabled. I did this. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3115","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3115","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3115"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3115\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3115"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3115"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3115"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}