Yii Framework Forum: PHP Notice – yii\base\ErrorException - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

PHP Notice – yii\base\ErrorException Use of undefined constant pathInfo - assumed 'pathInfo' Rate Topic: -----

#1 User is offline   shrikant p 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 31-July 16
  • Location:Bangalore

Posted 01 August 2016 - 12:04 AM

Hello,
I getting this bug while launching a project in local server.
I want to fix this bug. Do you know why I go this type of error?
pls...

PHP Notice – yii\base\ErrorException

Use of undefined constant pathInfo - assumed 'pathInfo'

1. in D:\xampp\htdocs\foldername\vendor\yiisoft\yii2\web\Request.php at line 719
$pathInfo = substr($pathInfo, strlen($scriptUrl));
} elseif ($baseUrl === '' || strpos($pathInfo, $baseUrl) === 0) {
$pathInfo = substr($pathInfo, strlen($baseUrl));
} elseif (isset($_SERVER['PHP_SELF']) && strpos($_SERVER['PHP_SELF'], $scriptUrl) === 0) {
$pathInfo = substr($_SERVER['PHP_SELF'], strlen($scriptUrl));
} else {
throw new InvalidConfigException('Unable to determine the path info of the current request.');
}

if (pathInfo[0] == '/') { //This line showing a error.
//pathInfo = substr($pathInfo, 1);
}

return (string) $pathInfo;
}

/**
* Returns the currently requested absolute URL.
* This is a shortcut to the concatenation of [[hostInfo]] and [[url]]
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,543
  • Joined: 12-October 09
  • Location:Croatia

Posted 01 August 2016 - 02:01 AM

Check the line you pointed for the error... you did not put the $ sign in front of the variable name.
Find more about me.... btw. Do you know your WAN IP?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users