PHP .user.ini paths were not changed

Created:

2016-11-16 13:05:59 UTC

Modified:

2017-08-08 13:43:43 UTC

0

Was this article helpful?


Have more questions?

Submit a request

PHP .user.ini paths were not changed

Applicable to:

  • Plesk 12.5 for Windows

Symptoms

After failed attempt to change vhost location with Plesk Reconfigurator, paths in .user.ini file, which contains domain custom PHP settings, were not changed.

Cause

Plesk reconfigurator was not finished correctly.

Resolution

Go to PHP settings for every domain and click Apply button.

Or

It can be done by using PowerShell script.

  1. Start a PowerShell console as an 'administrator'
  2. Run the following script to update host location in .user.ini

Note: Values of $new_vhost_location and $old_vhost_location are provided for an example and should be replaced with actual one.

$new_vhost_location="D:\\vhosts\\"
$old_vhost_location="C:\\\\inetpub\\\\vhosts\\\\" # Backslashes in `$old_vhost_location` folder path have to be doubled.

$configFiles = Get-ChildItem -Path $new_vhost_location -recurse -filter ".user.ini" -File
foreach ($file in $configFiles)
{
(Get-Content $file.PSPath) |
Foreach-Object { $_ -replace "$old_vhost_location", "$new_vhost_location" } |
Set-Content $file.PSPath
}
  1. Change \\\\ in $old_vhost_location value to single forward slash / and run the script again.
Have more questions? Submit a request
Please sign in to leave a comment.