use a different db driver (SQL Server) for a list view
displaying the list view
Fatal error: Class 'stdclass' not found in C:\inetpub\wwwroot\joomla7mysql\libraries\joomla\database\driver\mysqli.php on line 886
php 7
sqlsrv extension 4.0 non thread safe
IIS 7
joomla 3.6
SQL Server 2014
the issue doesn't arise using php 5.6 instead of php 7
php issue only for newly entered php 7?
why is it even looking in the mysqli.php file if this is a sql server install
a complete mystery
I ran into the same issue. The problem is that 'stdclass' is being passed as a parameter to the mysqli_fetch_object() which is then causing an error because it should be 'stdClass' and not 'stdclass'. To fix the issue, I did added a line of code in the /libraries/joomla/database/driver/mysqli.php file on line 886 that corrects the issue.
protected function fetchObject($cursor = null, $class = 'stdClass')
{
if($class == 'stdclass') $class = 'stdClass';
return mysqli_fetch_object($cursor ? $cursor : $this->cursor, $class);
}
That really shouldn't be necessary. Class names in PHP are case insensitive. I honestly suspect there is some environmental issue at play here and that there isn't something that could be patched in core to fix.
I can not replicate it.
Example:
// Load necessary libs
require 'console.php';
$db = JFactory::getDbo();
$db->setQuery('SELECT * FROM #__users');
$row = $db->loadObject('stdclass');
print_r($row);
We ran into some other issues. We thought these issues were related to PHP 7, so we moved back to PHP 5.6. We then setup the same site in a dev environment and could not replicate the issue. We then upgraded the site back to PHP 7 and all works well. The issue is not arising. I am not sure why. I wonder if something in the opcache was causing a conflict that stopped once cleared.
OK - closed
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-10-06 16:54:45 |
Closed_By | ⇒ | brianteeman |
Unfortunately, this error surfaced again. This time, I used opcache_reset() to clear the opcache and the error was resolved. This would indicate the problem exists within the opcache. I have yet to figure out how to reproduce the error.
I would suggest you've got a PHP issue then because
stdClass
is a part of the base PHP API and class names in PHP are case insensitive (only autoloaders seem to enforce a case sensitivity).