PHP Classes

Fatal error

Recommend this page to a friend!

      Professional Login System  >  All threads  >  Fatal error  >  (Un) Subscribe thread alerts  
Subject:Fatal error
Summary:Fatal error in the calss.users.php
Messages:6
Author:Jonathan Nsengi
Date:2015-09-11 15:20:26
 

  1. Fatal error   Reply   Report abuse  
Picture of Jonathan Nsengi Jonathan Nsengi - 2015-09-11 15:20:26
Hello, i'm getting the following error:

Fatal error: Call to undefined function USERS\locale_parse() in D:\xampp\htdocs\pro_login\lib\class\class.users.php on line 194

  2. Re: Fatal error   Reply   Report abuse  
Picture of Jonathan Nsengi Jonathan Nsengi - 2015-09-11 15:25:03 - In reply to message 1 from Jonathan Nsengi
I'm using PHP 5.5.9

  3. Re: Fatal error   Reply   Report abuse  
Picture of Ricky Scotti Ricky Scotti - 2015-09-11 15:44:26 - In reply to message 2 from Jonathan Nsengi
Open a new php file, and try this code:
print_r(locale_parse($_SERVER['HTTP_ACCEPT_LANGUAGE'])['language']);
echo '<br>Or<br>';
print_r(locale_parse($_SERVER['HTTP_ACCEPT_LANGUAGE']));

You should get this output:
riccardoscotti.com/test/phpclasses/ ...

  4. Re: Fatal error   Reply   Report abuse  
Picture of Najeeb Rashid Najeeb Rashid - 2015-09-12 17:00:53 - In reply to message 3 from Ricky Scotti
when running following code:
print_r(locale_parse($_SERVER['HTTP_ACCEPT_LANGUAGE'])['language']);
echo '<br>Or<br>';
print_r(locale_parse($_SERVER['HTTP_ACCEPT_LANGUAGE']));

getting the following result:

Fatal error: Call to undefined function locale_parse() in D:\wamp\www\pro_db\try.php on line 2

  5. Re: Fatal error   Reply   Report abuse  
Picture of Ricky Scotti Ricky Scotti - 2015-09-13 07:17:53 - In reply to message 4 from Najeeb Rashid
The problem is that you don't have PECL module installed.

You can change in file /lib/class.users.php this code:
$this->setValue('_language',locale_parse($_SERVER['HTTP_ACCEPT_LANGUAGE'])['language']);

in this:
$this->setValue('_language',explode('-',explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE'])[0])[0]);


Or install PECL in your webserver.
pecl.php.net/package/pecl_http

  6. Re: Fatal error   Reply   Report abuse  
Picture of Najeeb Rashid Najeeb Rashid - 2015-09-14 07:04:07 - In reply to message 5 from Ricky Scotti
Sir,
After changing the following code, getting other errors..

-- Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: No such host is known. in D:\wamp\www\pro_db\lib\class\class.users.php on line 174

-- Warning: file_get_contents(http://ipinfo.io/::1/json): failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known. in D:\wamp\www\pro_db\lib\class\class.users.php on line 174

-- Notice: Trying to get property of non-object in D:\wamp\www\pro_db\lib\class\class.users.php on line 175 to 179



-- Warning: Cannot modify header information - headers already sent by (output started at D:\wamp\www\pro_db\lib\class\class.users.php:174) in D:\wamp\www\pro_db\inc\init.php on line 39