Opened 18 months ago
Last modified 15 months ago
#58945 new defect (bug)
Issues with downloading and unpacking plugins with PHP 8.2
Reported by: | pablo07 | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | 6.2.2 |
Component: | Upgrade/Install | Keywords: | |
Focuses: | Cc: |
Description
Hello,
I've encountered an issue when trying to download and install plugins or update WordPress on PHP 8.2, both from the admin dashboard and using WP-CLI. This issue does not occur on PHP 8.1.
When attempting to install or update a plugin, the ZIP file is downloaded correctly, but when it comes to unzipping and installing, the process ends with an error of "Could not copy file.". The same issue occurs during a WordPress update.
I conducted a series of tests trying to pinpoint the issue. I carried out tests with both native PHP functions (curl, copy) and WordPress functions (download_url, unzip_file) that are typically used for downloading and installing plugins and updates.
Moreover, I noticed that the issue also arises when trying to update to a previous version via WP-CLI. In this case, after the ZIP file is downloaded, unzipped, and attempted to install, an error of "Warning: Could not copy file." is produced.
Here seems to be a WP-CLI cache clearing issue as empty zip files remain
Given the above, I suspect that the problem might be due to some incompatibility between PHP 8.2 and the WordPress functions used for downloading and installing plugins and updates.
Could someone take a look at this issue? Any help would be greatly appreciated.
:~/public_html$ wp plugin update classic-editor Downloading update from https://downloads.wordpress.org/plugin/classic-editor.1.6.3.zip... Unpacking the update... Installing the latest version... Removing the old version of the plugin... Plugin updated successfully. +----------------+-------------+-------------+---------+ | name | old_version | new_version | status | +----------------+-------------+-------------+---------+ | classic-editor | 1.6.1 | 1.6.3 | Updated | +----------------+-------------+-------------+---------+ Success: Updated 1 of 1 plugins. :~/public_html$ wp plugin update classic-editor --version=1.6.1 Installing Classic Editor (1.6.1) Downloading installation package from https://downloads.wordpress.org/plugin/classic-editor.1.6.1.zip... Unpacking the package... Installing the plugin... Removing the old version of the plugin... Plugin updated successfully. Success: Installed 1 of 1 plugins. :~/public_html$ wp plugin update classic-editor Downloading update from https://downloads.wordpress.org/plugin/classic-editor.1.6.3.zip... Using cached file '/home/***/.wp-cli/cache/plugin/classic-editor-1.6.3.zip'... Error: Error copying cached file /home/***/.wp-cli/cache/plugin/classic-editor-1.6.3.zip to https://downloads.wordpress.org/plugin/classic-editor.1.6.3.zip :~/.wp-cli/cache/plugin$ ls -l total 0 -rw-r--r-- 1 *** *** 0 Jul 31 10:40 classic-editor-1.6.1.zip -rw-r--r-- 1 *** *** 0 Jul 31 10:40 classic-editor-1.6.3.zip
Change History (3)
This ticket was mentioned in Slack in #core-upgrade-install by pbiron. View the logs.
17 months ago
#3
@
15 months ago
I have not been able to reproduce this issue in a local environment, however, I've noticed that it only occurs when utilizing the WordPress update function. I've tried various approaches to pinpoint the problem within PHP to no avail. If anyone has suggestions or needs further information to help resolve this issue, feel free to reach out.
I could not replicate and this using PHP 8.2.8 in Local app.