0

I just setup my QA environment and I am getting these errors I don't understand

A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant JSON_ERROR_NONE - assumed 'JSON_ERROR_NONE'

Filename: Description/ServiceDescription.php

Line Number: 48

A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant JSON_ERROR_DEPTH - assumed 'JSON_ERROR_DEPTH'

Filename: Description/ServiceDescription.php

Line Number: 48

A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant JSON_ERROR_STATE_MISMATCH - assumed 'JSON_ERROR_STATE_MISMATCH'

Filename: Description/ServiceDescription.php

Line Number: 48

This is a replica of my production code which is working fine, dont know what changed in the QA environment.

Varun Sheth
  • 146
  • 1
  • 1
  • 12
  • As a first step, always Google the error messages first (in this case, `Use of undefined constant`). – Pekka Jan 06 '14 at 18:45
  • possible duplicate of [What does the PHP error message "Notice: Use of undefined constant" mean?](http://stackoverflow.com/questions/2941169/what-does-the-php-error-message-notice-use-of-undefined-constant-mean) – Pekka Jan 06 '14 at 18:45
  • `define('JSON_ERROR_NONE', 'some value');` and then use it later with `echo JSON_ERROR_NONE;` – MonkeyZeus Jan 06 '14 at 18:46
  • You are probably missing quotes in the place where you are defining the constants. – Shankar Narayana Damodaran Jan 06 '14 at 18:46
  • The difference is that you're probably that you're suppressing notices in your production code, but not suppressing them in QA – Mark Baker Jan 06 '14 at 18:48
  • I already googled before I came to post here, however this is coming from the AWS SDK and the PHP error_reporting is currently switched off. – Varun Sheth Jan 06 '14 at 18:50
  • is Description/ServiceDescription.php your file? you should be able to tell if they're undefined or not – Jeff Hawthorne Jan 06 '14 at 18:59
  • These constants should be defined in PHP 5.3+: http://www.php.net/manual/en/json.constants.php – Jeremy Lindblom Jan 06 '14 at 19:06

1 Answers1

0

was missing the php5-json extension on ubuntu issue resolved

Varun Sheth
  • 146
  • 1
  • 1
  • 12
  • Glad you got it working. (For everyone else, see the related thread on the AWS PHP Development forum. https://forums.aws.amazon.com/thread.jspa?threadID=143258) – Jeremy Lindblom Jan 06 '14 at 19:38