I have 3 websites that I am migrating from 10.6 to 11.3.
The first 2 migrated cleanly.
For the 3rd one, however, when I run the Drupal 11 Upgrade Status report, I get an error message:
"Unable to write configuration for PHPStan to /tmp/upgrade_status/deprecation_testing.neon. Scanning is not possible until this is resolved.
Warning: file_put_contents(/tmp/upgrade_status/deprecation_testing.neon): Failed to open stream: Permission denied in Drupal\upgrade_status\DeprecationAnalyzer->createModifiedNeonFile() (line 582 of modules/contrib/upgrade_status/src/DeprecationAnalyzer.php)."
It sounds like a directory permissions issue, but, if so, I don't know what it is.
I ran:
mkdir -p /tmp/upgrade_status
sudo chmod 755 /tmp/upgrade_status
What else can I try?
Thanks in advance.
Comments
2nd try
I realized that I had posted a similar question a year ago. I solved a side issue, but I never resolved this primary directory permission issue.
There a few suggestions in
There a few suggestions in #3219353: PHPStan temporary config file not found due to incorrect temporary directory on Windows with XAMPP, maybe try those and if it doesn't help, leave a comment?
I see you created an issue with a lot of detail (#3544318: Unable to write configuration for PHPStan) which you could refer to in your comment, and add as a "Related issues links" in
#3219353?Also, to help other users, marking up code or CLI output as code is always appreciated.
Error resolved
Thanks for taking the time to reply.
I know there's a way to mark up code, but I keep forgetting how. Is there a Forum standards 101 site/document I should bookmark for future reference.
Regardless, I solved the problem. Hooray!
I modified one line in DeprecationAnalyzer.php and that did the trick.
I changed line 248 from:
$this->temporaryDirectory = $system_temporary . '/upgrade_status';to
$this->temporaryDirectory = DRUPAL_ROOT . '/sites/default/files/upgrade_status_tmp';and the error went away and I was able to move on.
In brief, I stopped using the system temp folder and changed to my own temp folder that I could control.
I hope this can help others.
Fantastic, thanks for sharing
Fantastic, thanks for sharing! Code is easily marked up by selecting the text and clicking the code button, in this case the number four option in the editor: Bold, Italic,
Strike Through,Code.