0

While executing my PHP code in editor (Eclipse), I am getting this error:

PHP Warning: Module 'json' already loaded in Unknown on line 0.

What's the problem here, and how do I fix it?

My code is

require_once(realpath(dirname(__FILE__) . "/../resources/config.php"));

require_once(LIBRARY_PATH . "/templateFunctions.php");

/*
    Now you can handle all your php logic outside of the template
    file which makes for very clean code!
*/

$setInIndexDotPhp = "Hey! I was set in the index.php file.";

// Must pass in variables (as an array) to use in template
$variables = array(
    'setInIndexDotPhp' => $setInIndexDotPhp
);

renderLayoutWithContentFile("home.php", $variables);

?>

2 Answers 2

0

This has nothing to do with the code in question. It's your PHP.ini (or another PHP configuration file), usually in /etc/php or /etc/php.ini. Somewhere, you've loaded the JSON module twice.

3
  • I have searched for the JSON in both the php.ini files. I have find the two occurrences but both are commented by ";" (semicolon).
    – Gnanendra
    Apr 7, 2011 at 4:19
  • There might be additional setting files somewhere like /etc/php/conf.d/. Worst case, this warning (not an error!) can be safely ignored.
    – ceejayoz
    Apr 7, 2011 at 4:21
  • How to ignore this worning. After ignoring this shall I go ahead with debugging....
    – Gnanendra
    Apr 7, 2011 at 4:24
0

I've done some research in php.ini, and read that I should remove the line:

extension=json.so

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.