[wp-trac] [WordPress Trac] #46040: Broken symlinks prevent updates

WordPress Trac noreply at wordpress.org
Fri Jan 18 21:36:58 UTC 2019


#46040: Broken symlinks prevent updates
--------------------------+-------------------------------------
 Reporter:  joemoto       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.0.3
 Severity:  normal        |   Keywords:  has-patch needs-testing
  Focuses:                |
--------------------------+-------------------------------------
 Soon after cPanel updated EasyApache 4 (EA4) (ea-php-
 cli-1.0.0-3.3.1.cpanel.x86_64) to use caching (a faster way to select the
 PHP executable, such as php-cli), I noticed some failed plugin updates.
 If appears that updated cPanel servers now create ".ea-php-cli.cache"
 broken symbolic links in the directory where a PHP script was executed by
 CLI (such as a CRON job or manual call).  The links are to a fake target
 (such as "ea-php71"), which is used by the perl script to select the
 executable.

 I already submitted https://github.com/CpanelInc/php-cli/issues/2 to
 cPanel, and already received a response.  The author of the pull request
 https://github.com/CpanelInc/php-
 cli/commit/883e8f1f3f37998d4501de4d4276c8a9d290fae3 may be changing how it
 caches; possibly creating the cache files in the "~/.cpanel" directory and
 cleaning up the littered files in the users' web directories.

 I have a working fix for WordPress, that I will attach in a moment.  The
 cause and effect is not limited to cPanel and WordPress, and the issue
 should be fixed on both sides.

 To replicate:
 1. Have WordPress 5.0.3 installed on a cPanel server that has ea-php-
 cli-1.0.0-3.3.1.cpanel.x86_64 installed. -- You can check using `rpm -q
 ea-php-cli-1.0.0-3.3.1.cpanel`.  Also '/usr/local/bin/php' is a text
 (perl) file, and not a binary/executable.
 1. Login into SSH/CLI and call any PHP file in a plugin, such as `php wp-
 content/plugins/akismet/class.akismet-cli.php`.
  a. You should then see a broken symlink in the "wp-
 content/plugins/akismet/" directory.
 1. Change the version number in the main plugin file "wp-
 content/plugins/akismet/akismet.php" to something lower, such as "4.0".
 1. Go to the WordPress >> Updates page and try to update the plugin.
  a. You will see an error "An error occurred while updating Akismet: The
 update cannot be installed because we will be unable to copy some files.
 This is usually due to inconsistent file permissions. .ea-php-cli.cache"
 1. You can delete the symlink or apply the patch, and the update will be
 successful.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/46040>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list