0

Brand new WP application on Cloudways hosting. Their tech support unable to resolve. Updating via backend or WP CLI results in error. Directory created but files not copied into it. Seems to be a PHP error.

Installing Media Cleaner – Clean & Optimize Space (6.4.5)                                                                                                
Downloading installation package from https://downloads.wordpress.org/plugin/media-cleaner.6.4.5.zip...                                                  
Unpacking the package...                                                                                                                                 
Installing the plugin...                                                                                                                                 
PHP Fatal error:  Uncaught Error: Call to undefined function fcp_copy_dir() in /home/path/to/my/wordpress/app/public_html/wp-admin/includes/fi
le.php:1896                                                                                                                                              
Stack trace:                                                                                                                                             
#0 /home/path/to/my/wordpress/app/public_html/wp-admin/includes/class-wp-upgrader.php(596): copy_dir()                                        
#1 /home/path/to/my/wordpress/app/public_html/wp-admin/includes/class-wp-upgrader.php(798): WP_Upgrader->install_package()                    
#2 /home/path/to/my/wordpress/app/public_html/wp-admin/includes/class-plugin-upgrader.php(137): WP_Upgrader->run()                            
#3 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(552): Plugin_Upgrader->install()                                      
#4 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(209): Plugin_Command->install_from_repo()                  
#5 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(809): WP_CLI\CommandWithUpgrade->install()                            
#6 [internal function]: Plugin_Command->install()                                                                                                        
#7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Di in /home/path/to/my/wordpress/app/public_html/wp-admin/includes/file.php on lin
e 1896                                                                                                                                                   
Fatal error: Uncaught Error: Call to undefined function fcp_copy_dir() in /home/path/to/my/wordpress/app/public_html/wp-admin/includes/file.ph
p:1896                                                                                                                                                   
Stack trace:                                                                                                                                             
#0 /home/path/to/my/wordpress/app/public_html/wp-admin/includes/class-wp-upgrader.php(596): copy_dir()                                        
#1 /home/path/to/my/wordpress/app/public_html/wp-admin/includes/class-wp-upgrader.php(798): WP_Upgrader->install_package()                    
#2 /home/path/to/my/wordpress/app/public_html/wp-admin/includes/class-plugin-upgrader.php(137): WP_Upgrader->run()                            
#3 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(552): Plugin_Upgrader->install()                                      
#4 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/WP_CLI/CommandWithUpgrade.php(209): Plugin_Command->install_from_repo()                  
#5 phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(809): WP_CLI\CommandWithUpgrade->install()                            
#6 [internal function]: Plugin_Command->install()                                                                                                        
#7 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Di in /home/path/to/my/wordpress/app/public_html/wp-admin/includes/file.php on lin
e 1896                                                                                                                                                   
Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.

Tried with various plugins & themes; same result.

PHP version & SQL version on origin site matches destination.

3 Answers 3

4

For the benefit of anyone else finding this off the back of a search query, I had the same issue with fcp_copy_dir() function not found.

Cause: I'd migrated the site from a Flywheel instance. fcp_copy_dir() seems to be a custom Flywheel function they've added to WP core. Core WP runs into errors when run in non-Flywheel environments.

Diagnosis: Use wp core verify-checksums to validate the integrity of WP core. In my case, this showed 3 files had been modified.

Resolution: Revert to a clean WP core.

2

Just a follow up, thank you for this it pointed me in the right direction. This still seems to be a problem migrating from FlyWheel. There are a few other issues I run into as well.

For anyone still having problems

  • They still make changes to WordPress core which causes the problem with fcp_copy_dir() so reverting wordpress core is still required.
  • They also make changes to wp-settings with some hard coded paths that are specific to flywheel looking for .fw-config.php which needs to be removed.

I found this article with a bit more background and detail which fixed my issues https://wordify.com/blog/how-to-migrate-wordpress-from-flywheel-to-wordify/

0

Looks like the Cloudways migration didn't complete properly. Reinstalling WordPress from the dashboard solved it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.