PhpClass 'official client' NOTFound: install the latest php_mongodb.dll extension corresponding to the official version for php7.0.4 in windows. the extension version is 1.1.6 and supports the highest version of MongoDB3.2 and php7.0 ,; you can see the MongoDB extension in phpinfo,
However, when the namespace is not used, the following error occurs in new guest client ();
Fatal error: Uncaught Error: Class 'warning client' not found in E: \ ...... why ?? Excuse me
Version support, for example (pay attention to the line mongodb1.1)
1. extended support for MOngoDB
2. extended support for php
Reply to discussion (solution)
I have never used it.
But how do you know there must be a consumer client class?
You need at least
Print_r (get_extension_funcs ('mongodb '));
Let's take a look at the functions provided in the extension.
Print_r (get_declared_classes ());
Check whether the pre-defined class has the class name you need (or similar ).
The official php.net documentation is used in this way by the new protocol client ()
I am not sure whether this type is available, is it true that I have not installed the corresponding VC?
Why can't I find vc14 online?
@ Xuzuning
Didn't I ask you to take a look?
What's so hard at hand?
Array
(
[0] => MongoDB \ BSON \ fromPHP
[1] => MongoDB \ BSON \ toPHP
[2] => MongoDB \ BSON \ toJSON
[3] => MongoDB \ BSON \ fromJSON
)
Array
(
[0] => stdClass
[1] => Exception
[2] => ErrorException
[3] => Error
[4] => ParseError
[5] => TypeError
[6] => ArithmeticError
[7] => DivisionByZeroError
[8] => Closure
[9] => Generator
[10] => ClosedGeneratorException
[11] => DateTime
[12] => DateTimeImmutable
[13] => DateTimeZone
[14] => DateInterval
[15] => DatePeriod
[16] => LogicException
[17] => BadFunctionCallException
[18] => BadMethodCallException
[19] => DomainException
[20] => InvalidArgumentException
[21] => LengthException
[22] => OutOfRangeException
[23] => RuntimeException
[24] => OutOfBoundsException
[25] => OverflowException
[26] => RangeException
[27] => UnderflowException
[28] => UnexpectedValueException
[29] => RecursiveIteratorIterator
[30] => IteratorIterator
[31] => FilterIterator
[32] => RecursiveFilterIterator
[33] => CallbackFilterIterator
[34] => RecursiveCallbackFilterIterator
[35] => ParentIterator
[36] => LimitIterator
[37] => CachingIterator
[38] => RecursiveCachingIterator
[39] => NoRewindIterator
[40] => AppendIterator
[41] => InfiniteIterator
[42] => RegexIterator
[43] => RecursiveRegexIterator
[44] => EmptyIterator
[45] => RecursiveTreeIterator
[46] => ArrayObject
[47] => ArrayIterator
[48] => RecursiveArrayIterator
[49] => SplFileInfo
[50] => DirectoryIterator
[51] => FilesystemIterator
[52] => RecursiveDirectoryIterator
[53] => GlobIterator
[54] => SplFileObject
[55] => SplTempFileObject
[56] => spldoublyasklist
[57] => SplQueue
[58] => SplStack
[59] => SplHeap
[60] => SplMinHeap
[61] => SplMaxHeap
[62] => SplPriorityQueue
[63] => SplFixedArray
[64] => SplObjectStorage
[65] => MultipleIterator
[66] => ReflectionException
[67] => Reflection
[68] => ReflectionFunctionAbstract
[69] => ReflectionFunction
[70] => ReflectionGenerator
[71] => ReflectionParameter
[72] => ReflectionType
[73] => ReflectionMethod
[74] => ReflectionClass
[75] => ReflectionObject
[76] => ReflectionProperty
[77] => ReflectionExtension
[78] => ReflectionZendExtension
[79] => SessionHandler
[80] => _ PHP_Incomplete_Class
[81] => php_user_filter
[82] => Directory
[83] => AssertionError
[84] => ZipArchive
[85] => LibXMLError
[86] => DOMException
[87] => DOMStringList
[88] => DOMNameList
[89] => DOMImplementationList
[90] => DOMImplementationSource
[91] => DOMImplementation
[92] => DOMNode
[93] => DOMNameSpaceNode
[94] => DOMDocumentFragment
[95] => DOMDocument
[96] => DOMNodeList
[97] => DOMNamedNodeMap
[98] => DOMCharacterData
[99] => DOMAttr
[100] => DOMElement
[1, 101] => DOMText
[1, 102] => DOMComment
[1, 103] => DOMTypeinfo
[1, 104] => DOMUserDataHandler
[105] => DOMDomError
[1, 106] => DOMErrorHandler
[1, 107] => DOMLocator
[2, 108] => DOM
[1, 109] => DOMCdataSection
[110] => DOMDocumentType
[1, 111] => DOMNotation
[2, 112] => Domenti
[113] => DOMEntityReference
[2, 114] => DOMProcessingInstruction
[115] => DOMStringExtend
[116] => DOMXPath
[117] => PDOException
[118] => PDO
[119] => PDOStatement
[120] => PDORow
[121] => SimpleXMLElement
[122] => SimpleXMLIterator
[123] => XMLReader
[124] => XMLWriter
[125] => PharException
[126] => Phar
[127] => PharData
[128] => PharFileInfo
[129] => CURLFile
[130] => finfo
[131] => MongoDB \ Driver \ Command
[132] => MongoDB \ Driver \ Cursor
[133] => MongoDB \ Driver \ CursorId
[134] => MongoDB \ Driver \ Manager
[135] => MongoDB \ Driver \ Query
[136] => MongoDB \ Driver \ ReadConcern
[137] => MongoDB \ Driver \ ReadPreference
[138] => MongoDB \ Driver \ Server
[139] => MongoDB \ Driver \ BulkWrite
[140] => MongoDB \ Driver \ WriteConcern
[141] => MongoDB \ Driver \ WriteConcernError
[142] => MongoDB \ Driver \ WriteError
[143] => MongoDB \ Driver \ WriteResult
[144] => MongoDB \ Driver \ Exception \ LogicException
[145] => MongoDB \ Driver \ Exception \ RuntimeException
[146] => MongoDB \ Driver \ Exception \ UnexpectedValueException
[147] => MongoDB \ Driver \ Exception \ InvalidArgumentException
[148] => MongoDB \ Driver \ Exception \ ConnectionException
[149] => MongoDB \ Driver \ Exception \ AuthenticationException
[150] => MongoDB \ Driver \ Exception \ SSLConnectionException
[151] => MongoDB \ Driver \ Exception \ WriteException
[152] => MongoDB \ Driver \ Exception \ BulkWriteException
[153] => MongoDB \ Driver \ Exception \ ExecutionTimeoutException
[154] => MongoDB \ Driver \ Exception \ ConnectionTimeoutException
[155] => MongoDB \ BSON \ Binary
[156] => MongoDB \ BSON \ Javascript
[157] => MongoDB \ BSON \ MaxKey
[158] => MongoDB \ BSON \ MinKey
[159] => MongoDB \ BSON \ ObjectID
[160] => MongoDB \ BSON \ Regex
[161] => MongoDB \ BSON \ Timestamp
[162] => MongoDB \ BSON \ UTCDateTime
[163] => mysqli_ SQL _exception
[2, 164] => mysqli_driver
[165] => mysqli
[166] => mysqli_warning
[2, 167] => mysqli_result
[2, 168] => mysqli_stmt
[1, 169] => SoapClient
[170] => SoapVar
[171] => SoapServer
[1, 172] => SoapFault
[173] => SoapParam
[174] => SoapHeader
[175] => SQLite3
[1, 176] => SQLite3Stmt
[177] => SQLite3Result
[178] => effectprocessor
)
Only a few things related to MongoDB
The reason is found because the old version of php_mongo.dll uses the MongoClient class for connection. The new version of php_mongodb.dll is connected using MongoDB \ Driver \ Manager. Note that the namespace of this class cannot be omitted.
This is the old reference document http://php.net/manual/zh/book.mongo.php
This is the new reference document http://php.net/manual/zh/book.mongodb.php
The usage of the new version is as follows:
$con = new MongoDB\Driver\Manager('mongodb://127.0.0.1:27017');$query = new MongoDB\Driver\Query([]);$cursor = $con->executeQuery('databaseName.collectionName',$query);$it = new IteratorIterator($cursor);$it->rewind();while ($doc=$it->current()) {print_r($doc);$it->next();echo '
';}