You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-3
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,7 @@ WampServer PHP CLI Version Changer is a Microsoft Windows batch script that allo
14
14
*[How To Use](#how-to-use)
15
15
*[Text Based User Interface (TUI)](#text-based-user-interface-tui)
16
16
*[Command Line Interface (CLI)](#command-line-interface-cli)
17
+
*[Session Mode](#session-mode)
17
18
*[FAQ's](#faqs)
18
19
19
20
## Minimum Requirements
@@ -26,7 +27,7 @@ The following are required for the CLI Changer script to function correctly.
26
27
27
28
No installation is required.
28
29
29
-
At just over 10kB the CLI Changer script is small enough to be saved anywhere in your file system.
30
+
At just over 13KB the CLI Changer script is small enough to be saved anywhere in your file system.
30
31
31
32
**Tip:** Once you have save the CLI Changer script, create a desktop shortcut to it for quick and easy access.
32
33
@@ -51,6 +52,7 @@ rem | User Defined Variable(s) |
51
52
rem +------------------------------------------------+
52
53
53
54
rem WampServer custom install path.
55
+
rem Note: Trailing slash is not required.
54
56
set $customInstallPath=D:\WampServer 64-Bit
55
57
```
56
58
@@ -62,6 +64,7 @@ There are two ways you can use the CLI Changer script.
62
64
63
65
* Text based user interface (TUI).
64
66
* Command line interface (CLI).
67
+
* Session mode
65
68
66
69
### Text Based User Interface (TUI)
67
70
@@ -128,6 +131,31 @@ Following execution, an exit code will be given:
128
131
129
132
**Tip:** Calling scripts via the command line is common during (automated) development, testing and deployment. EG: Incorporate it into your build files...
130
133
134
+
#### Session Mode
135
+
136
+
Should you have the need to only change the PHP version number within an open command window (session) and not across your whole system then you can use the `--temp` option.
The short command line option `-t` is also available.
149
+
150
+
**Note:** Enclosing the script path in quotes if it contains spaces and knowing the available PHP CLI version(s) in advance is still required.
151
+
152
+
Following execution, an exit code will be given:
153
+
154
+
-`0` - Success
155
+
-`1` - Failure
156
+
157
+
**Note:** Using the `--temp` or `-t` option will only change the PHP version number within that command window. Multiple command windows can be open and the PHP version number changed without affecting other open command windows.
158
+
131
159
## FAQ's
132
160
133
161
### What are environment path variables and how do they work?
@@ -136,11 +164,14 @@ Environment 'path' variables allow the user (and system) to call an executable w
136
164
137
165
When the user (or the user's script) calls `php` or `php.exe`, the path pointing to the executable will be used. If an environment path contains two or more paths to a PHP executable, then only the first one found is executed. The other php executables will never be called, ever.
138
166
139
-
Based on this information and pursuant to the successful selection of a PHP version number, this script scans and then removes any and all reference to any php executable path(s) found within the environment 'user' path prior to appending the selected PHP version path.
167
+
Based on this information and pursuant to the successful selection of a PHP version number, this script scans and then removes any and all reference to any php executable path(s) found within the environment 'user' path (or the cmd window 'session' path) prior to appending the selected PHP version path.
140
168
141
169
The PHP CLI version number returned by typing `php -v` at the command prompt should be the same as that selected by you when using this script. If it is not, there is a strong chance that there is reference to a PHP executable within the environment 'system' path. To correct this situation, you must remove this reference from the environment 'system' path manually.
142
170
143
-
Both the environment 'user' and 'system' paths can be accessed by clicking 'Start' -> 'Control Panel' -> 'System' -> 'Advanced system settings' -> 'Environment Variables...'
171
+
Access the environment 'user' and 'system' paths by:
172
+
173
+
* Windows 7: Clicking 'Start' -> 'Control Panel' -> 'System' -> 'Advanced system settings' -> 'Environment Variables...'
174
+
* Windows 10: Clicking 'Start Search' -> Type 'env' -> Click the result 'Edit system environment variables' -> 'Environment Variables...'
144
175
145
176
### How do I remove the error at the bottom of the WampServer right-click menu?
0 commit comments