@@ -19,10 +19,10 @@ Download and Install
19
19
Before you begin developing, ensure that you have the following
20
20
dependencies installed on your local machine:
21
21
22
- - `PHP <https://www.php.net/manual/en/install.php>`__
23
- - `Composer <https://getcomposer.org/download/>`__
22
+ - `PHP <https://www.php.net/manual/en/install.php>`__ version 7.4 or later
23
+ - `Composer <https://getcomposer.org/download/>`__ version 2.0 or later
24
24
25
- .. step:: Install the MongoDB extension
25
+ .. step:: Install the MongoDB PHP extension
26
26
27
27
Run the following command to install the ``mongodb`` PHP extension:
28
28
@@ -32,17 +32,17 @@ Download and Install
32
32
33
33
.. step:: Update your PHP configuration file
34
34
35
- To enable the ``mongodb`` extension, add the following line to the top of
36
- your ``php.ini`` file:
35
+ To enable the ``mongodb`` extension in your PHP configuration file, add the
36
+ following line to the top of your ``php.ini`` file:
37
37
38
- .. code-block:: bash
38
+ .. code-block:: none
39
39
40
40
extension=mongodb.so
41
41
42
42
.. tip::
43
43
44
44
You can locate your ``php.ini`` file by running the following command
45
- from your shell:
45
+ in your shell:
46
46
47
47
.. code-block:: bash
48
48
@@ -57,13 +57,26 @@ Download and Install
57
57
58
58
mkdir php-quickstart
59
59
60
- Run the following commands to create a ``quickstart.php`` application file in
61
- the ``php-quickstart`` directory:
60
+ Select the tab corresponding to your operating system and run following commands
61
+ to create a ``quickstart.php`` application file in the ``php-quickstart`` directory:
62
62
63
- .. code-block:: bash
63
+ .. tabs::
64
+
65
+ .. tab:: macOS / Linux
66
+ :tabid: create-file-mac-linux
67
+
68
+ .. code-block:: bash
69
+
70
+ cd php-quickstart
71
+ touch quickstart.php
64
72
65
- cd php-quickstart
66
- touch quickstart.php
73
+ .. tab:: Windows
74
+ :tabid: create-file-windows
75
+
76
+ .. code-block:: bash
77
+
78
+ cd php-quickstart
79
+ type nul > quickstart.php
67
80
68
81
.. step:: Install the {+php-library+}
69
82
@@ -75,13 +88,15 @@ Download and Install
75
88
composer require mongodb/mongodb
76
89
77
90
After installing the library, include Composer's ``autoload.php`` file by adding the
78
- following line to ``quickstart.php``:
91
+ following code to the top of your ``quickstart.php`` file :
79
92
80
- .. code-block:: bash
93
+ .. code-block:: php
94
+
95
+ <?php
81
96
82
97
require_once __DIR__ . '/vendor/autoload.php';
83
98
84
- After you complete these steps, you have a new project directory
85
- and the library dependencies installed.
99
+ After you complete these steps, you have a new project directory, a
100
+ new application file, and the library dependencies installed.
86
101
87
102
.. include:: /includes/get-started/troubleshoot.rst
0 commit comments