File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # PHP Version Not Found
2+
3+ ## Problem
4+
5+ Running ` phat switch [version] ` says the version isn't found even though you believe it's installed.
6+
7+ ## Cause
8+
9+ Phat looks for PHP installations using a specific naming convention. If the folder name doesn't match the expected pattern, Phat won't recognize it.
10+
11+ ## Solution
12+
13+ Make sure the PHP folder is named correctly. Phat looks for folders named ` php[version] ` , for example:
14+
15+ ### Correct Naming Examples
16+
17+ ✅ ** Correct:**
18+ - ` C:\xampp\php7.4.33 `
19+ - ` C:\xampp\php8.2.27 `
20+ - ` C:\xampp\php8.3.15 `
21+ - ` C:\xampp\php8.1.0 `
22+
23+ ❌ ** Incorrect:**
24+ - ` C:\xampp\php-7.4.33 ` (contains dash)
25+ - ` C:\xampp\PHP7.4.33 ` (uppercase PHP)
26+ - ` C:\xampp\php_7.4.33 ` (contains underscore)
27+ - ` C:\xampp\php-7.4 ` (incomplete version)
28+
29+ ### Active PHP Version
30+
31+ The currently active version should be in a folder named exactly:
32+ ```
33+ C:\xampp\php
34+ ```
35+
36+ ## Checking Installed Versions
37+
38+ List all recognized PHP versions:
39+
40+ ``` powershell
41+ phat list
42+ ```
43+
44+ This will show which versions Phat can detect.
45+
46+ ## Renaming Folders
47+
48+ If your folder is named incorrectly:
49+
50+ 1 . Stop Apache if it's running
51+ 2 . Rename the folder to match the correct pattern
52+ 3 . Run ` phat list ` to verify Phat can now see it
53+
54+ ### Example
55+
56+ If you have ` C:\xampp\php-8.2.27 ` , rename it to:
57+ ```
58+ C:\xampp\php8.2.27
59+ ```
60+
61+ ## Verification
62+
63+ After renaming, verify the version is detected:
64+
65+ ``` powershell
66+ phat list
67+ ```
68+
69+ You should see your version in the output.
70+
71+ ## Related Resources
72+
73+ - [ Back to Troubleshooting Index] ( TROUBLESHOOTING.md )
You can’t perform that action at this time.
0 commit comments