mlocati / powershell-phpmanager

A PowerShell module to install/update PHP, PHP extensions and Composer on Windows

Home Page:https://www.powershellgallery.com/packages/PhpManager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Set-Content : Stream was not readable

compuvin opened this issue · comments

Randomly when trying to enable or disable a PHP Extension I get the following error message and the INI file is completely cleared(!):

image

Obviously the big thing is the clearing out of the file. I attempted to remedy it a few different ways but was unsuccessful. The cause, I'm guessing, is that IIS is checking for changes to the PHP.ini file in the FastCGI application and if I get it just at that moment, the error occurs.

Could you try to edit the file C:\Program Files\WindowsPowerShell\Modules\PhpManager\1.14.0.179\private\Set-PhpIniLine.ps1 with these changes to see if it's ok?

Unfortunately I am still getting the error at the Set-Content line (now line 32) and the ini file was emptied.

Did you close and reopen the powershell window after editing the file? (Otherwise powershell uses the previous version of the file, without the edits)

Yes, I did close powershell and reopen it.

Michele, that seems to have done it. I couldn't get it to break this time. Thanks for the fix.

I just released a new version.
To update it, simply open a powershell prompt with admin rights and execute this command:

Update-Module PhpManager -Force