To update where we are (both for your information, and for anyone else reading the thread):
We found an unexpected confounding factor from our tests.
We had a report that on some Windows 7 and 10 PCs currently using a PHP 7.3 EXE compiled with 2020, after installing VC 17, installing VC16 was necessary. Without this step, neither the previously working PHP 7.3 nor the PHP 8.1 compiled with 2024.2 would start. After VC16 was installed, both EXEs would start and run normally. I found this extremely confusing for two reasons:
-
PHP 8.1 requires VC17 … if that’s already installed, adding VC16 would seem both irrelevant (VC17 is there) and useless (the EXE requires VC16).
-
Nothing was uninstalled, and if a PHP 7.3 EXE was previously working on the PC with whatever was installed, adding VC 17 should not interfere.
Trying to understand this, I used remote desktop software to watch the process on an affected Windows 7 PC. I noticed that what the person was applying was the x86 version of VC16 (after our normal deployment installed the x64 version of VC17, matching the PC system type which reports as x64).
I uninstalled all VC, and installed only the x86 version of VC17. Both PHP 7.3 and 8.1 worked in this configuration. Therefore, it seems that x86 VC is required on some PCs, even if the system type reports as x64.
To run PHP 8.1 on x64 PCs, x64 VC has been sufficient on all Windows 11 PCs, most but not all Windows 10 PCs, and no Windows 7 PCs.
I inspected our EXEs in a hex editor, and they show as a 32-bit EXEs.
I think earlier you said the choice of x64 or x86 should match the system type, but based on my observations, at least on Windows 7 it seems the choice needs to match the 32-bit EXE (not the 64-bit system type).
Questions:
a) does this mean we should be installing the x86 VC even on x64 PCs?
b) do our observations about x86 vs x64 on different versions of Windows make sense, matching what you would expect to be needed by EXEs generated by exeoutput?
Our current strategy is to install x86 VC on Windows 7 and x64 VC on Windows 11, and manually fix Windows 10 x64 PCs that need the x86 VC.
I’m still confused about item #2 above - why installing VC 17 x64 on a PC with VC 16 x86 (so both versions of VC were in place) made a PHP 7.3 from exeoutput 2020 stop working (unable to start) when it had been working before. Nothing was removed, and if the EXE was reaching for x86 it was still there. Yet somehow the existence of the x64 version of VC17 made the EXE unable to start. I don’t understand that. (It may not be important.)
My prior question (17 days ago) was about whether there is a maximum (not minimum) version of VC needed to run a version of PHP, since due to that observation, the existence of VC 17 made the EXE fail to start. That is, do we need to avoid installing VC 17 on PCs that will be running PHP 7.3?
To give an update about my prior question, current tests indicate that VC 17 is compatible with PHP 7.3. When I install VC 17 x86 on affected PCs, the PHP 7.3 EXE starts and works normally. (But I’m still confused how the PC got into a state where the EXE would not start when installing VC 17 x64.)
It gets even more bizarre. I’ve seen a case where an EXE starts under one filename, but when copied to another filename won’t start (where that filename was previously used to try running an EXE compiled with a later version of PHP incompatible with the installed VC). I suspect there’s some kind of caching by filename about a file going on within Windows that isn’t cleared by replacing the file. If so, that might contribute to some of my puzzling reports, where I thought I was cleanly testing the EXE file in place, but in fact cached incorrect information in Windows was making the test not clean. That hypothesis is highly speculative, I really do not understand this symptom.