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
+21-1Lines changed: 21 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ This repository contains a PowerShell module that implements functions to instal
10
10
## Installation
11
11
12
12
You'll need at least PowerShell version 5: in order to determine which version you have, open PowerShell and type:
13
+
13
14
```powershell
14
15
$PSVersionTable.PSVersion.ToString()
15
16
```
@@ -88,26 +89,34 @@ It's often handy to be able to use different PHP versions for different projects
88
89
For instance, sometimes you may want that `php.exe` is PHP 5.6, sometimes you may want that `php.exe` is PHP 7.2.
89
90
This module let's you easily switch the *current* PHP version (that is, the one accessible without specifying the `php.exe` path) with the concept of **PHP Switcher**.
90
91
First, you install the PHP versions you need:
92
+
91
93
```powershell
92
94
Install-Php -Version 5.6 -Architecture x86 -ThreadSafe $true -Path C:\Dev\PHP5.6 -TimeZone UTC
93
95
Install-Php -Version 7.2 -Architecture x86 -ThreadSafe $true -Path C:\Dev\PHP7.2 -TimeZone UTC
94
96
```
97
+
95
98
Then you initialize the PHP Switcher, specifying where the *current* PHP version should be available:
You can use the `Remove-PhpFromSwitcher` to remove a PHP installation from the PHP Switcher, `Move-PhpSwitcher` to change the directory where `php.exe` will be visible in (`C:\Dev\PHP` in the example above), and `Remove-PhpSwitcher` to remove the PHP Switcher.
125
135
126
136
If you want to let **Apache** work with PHP, you have to add the `LoadModule` directive to the Apache configuration file, which should point to the appropriate DLL.
In order to simplify switching the PHP version used by Apache, the `Install-Php` command creates a file called `Apache.conf` in the PHP installation directory, containing the right `LoadModule` definition.
136
150
So, in your Apache configuration file, instead of writing the `LoadModule` directive, you can simply write:
151
+
137
152
```
138
153
Include "C:\Dev\PHP\Apache.conf"
139
154
```
155
+
140
156
That's all: to switch the PHP version used by Apache simply call `Switch-Php` and restart Apache.
You can run the `test\setup.ps1` PowerShell script to install them.
300
316
The `test\pester.ps1` script executes all the tests, which are located in the `test\tests` directory.
301
317
You can test a specific case by specifying its name:
318
+
302
319
```powershell
303
320
.\test\pester.ps1 Edit-FolderInPath
304
321
```
322
+
305
323
Some tests may require to run commands with elevated privileges. These tests are disabled by default: you can enable them by setting the `PHPMANAGER_TEST_RUNAS` environment variable to a non empty value:
324
+
306
325
```powershell
307
326
$Env:PHPMANAGER_TEST_RUNAS=1
308
327
.\test\pester.ps1 Edit-FolderInPath
309
328
```
329
+
310
330
Some other tests require that [Node.js](https://nodejs.org) is installed and available in the PATH environment variable.
311
331
312
332
313
333
## Do you want to really say thank you?
314
334
315
-
You can offer me a [montly coffee](https://github.com/sponsors/mlocati) or a [one-time coffee](https://paypal.me/mlocati):wink:
335
+
You can offer me a [monthly coffee](https://github.com/sponsors/mlocati) or a [one-time coffee](https://paypal.me/mlocati):wink:
0 commit comments