• 14

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

My server configurations:

[root@server ~]# php -v 
PHP 7.0.22 (cli) (built: Aug 7 2017 16:18:27) ( NTS ) 

[root@server ~]# nginx -v 
nginx version: nginx/1.10.2

OS: CentOS 7.3.1611 (Core)

Details of my YUM installation:

[root@server ~]# yum list installed | grep php
php70u-cli.x86_64                       7.0.22-2.ius.centos7           @ius     
php70u-common.x86_64                    7.0.22-2.ius.centos7           @ius     
php70u-fpm.x86_64                       7.0.22-2.ius.centos7           @ius     
php70u-fpm-nginx.noarch                 7.0.22-2.ius.centos7           @ius     
php70u-mysqlnd.x86_64                   7.0.22-2.ius.centos7           @ius     
php70u-pdo.x86_64                       7.0.22-2.ius.centos7           @ius  

Here is the details of the investigation: I tried executing following code in test.php:

Here are my system details: PHP Version => 7.0.22 OS: I am trying to execute following code in test2.php:

$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);
echo json_encode($arr);

And, getting the following error:

[root@server ~]# php /tmp/test2.php
**PHP Fatal error:  Uncaught Error: Call to undefined function json_encode() in /tmp/test2.php:3**

How to resolve this?

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions