Tagged: kriesi
-
AuthorPosts
-
July 20, 2015 at 11:22 pm #476190
Thanks for the detailed research Richard. I’ve been trying to tell them this for weeks.
- This reply was modified 9 years, 5 months ago by DJQuad.
July 22, 2015 at 5:59 am #476862Hey!
@Hyperopic: Thank you for the detailed info. So a temporary folder is being created on the C:\Windows\Temp directory? Is this the same directory set in the upload_tmp_dir directive when you check the php info page? Is the url limitation, in some way, related to this article?https://technet.microsoft.com/en-us/library/ff919564(v=office.14).aspx#limits
I’m sorry if we asked a lot of questions instead of providing one but, unfortunately, we are not server administrators so we are not familiar with this stuff. We will forward this info to Kriesi, maybe he can ask envato or themeforest to shorten the url path.
Best regards,
IsmaelJuly 22, 2015 at 10:04 am #476948The temporary file, which is the zip file being downloaded, is created in C:\Windows\Temp; the upload_tmp_dir directive location. However, it is the extraction of the zip file which is failing, when it attempts to create the output directories in the WordPress upgrade folder. This is where the limitation comes in to play. The article relates to URL length so isn’t relevent, this has more detail on the NTFS limits, including that Windows can support longer paths, but only if you call Unicode versions of the functions with a modified version of the path!! https://msdn.microsoft.com/en-gb/library/windows/desktop/aa365247%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396#maxpath
The limitation is not the URL, but in the NTFS filesystem. The maximum file path in Windows current versions is 260 characters, including the drive letter assignment and trailing NUL character. In the example I gave, this download file path in the C:\Windows\Temp directory is 247 characters. When the zip file is being extracted however, it tries to create a folder in C:\IMCWebsiteDev\wwwroot\wp-content\upgrade named with the long file name. In total this comes to 272 characters, so directory creation fails and we get the error message.
The good news is that I’ve submitted a simple patch to WordPress Core, and it looks as it will be out in the build fairly soon.
If anyone wants to fix this issue on their site, the required edit is in wp-admin/includes/file.php where you edit line 457 (v4.2.2, other versions may vary) The edit required is to change
$tmpfname = wp_tempnam( $url );
to
$tmpfname = wp_tempnam( parse_url( $url, PHP_URL_PATH ) );
to strip off the query string from the resulting filename. THIS IS AT YOUR OWN RISK!!! but it has worked on my installs.–Richard
- This reply was modified 9 years, 5 months ago by Hyperopic.
July 22, 2015 at 10:33 am #476961Hey!
@Hyperopic: Thank you for the clarification. We hope the patch fix the issue for everyone else here.Cheers!
Ismael -
AuthorPosts
- The topic ‘An error occurred while updating Enfold: Could not create directory.’ is closed to new replies.