Title: fatal error &#8230; Call to undefined function ssh2_sftp_realpath()
Last modified: July 17, 2021

---

# fatal error … Call to undefined function ssh2_sftp_realpath()

 *  Resolved [willlettuce](https://wordpress.org/support/users/willlettuce/)
 * (@willlettuce)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-ssh2_sftp_realpath/)
 * When I try to activate the SG Optimizer plugin, I get the error message below(
   with my URL edited out).
 * The last change I made to the site was installing this plugin–[https://wordpress.org/plugins/ssh-sftp-updater-support/–but](https://wordpress.org/plugins/ssh-sftp-updater-support/–but)
   the error persists even after deleting this plugin.
 * I’m afraid I’m a beginner, and don’t know where to go from here. Thanks so much
   for your help!
 * Warning: file_exists(): Unable to find the wrapper “ssh2.sftp” – did you forget
   to enable it when you configured PHP? in /home/customer/www/example.com/public_html/
   wp-admin/includes/class-wp-filesystem-ssh2.php on line 564
 * Fatal error: Uncaught Error: Call to undefined function ssh2_sftp_realpath() 
   in /home/customer/www/example.com/public_html/wp-admin/includes/class-wp-filesystem-
   ssh2.php:302 Stack trace: #0 /home/customer/www/example.com/public_html/wp-admin/
   includes/class-wp-filesystem-base.php(259): WP_Filesystem_SSH2->cwd() #1 /home/
   customer/www/example.com/public_html/wp-admin/includes/class-wp-filesystem-base.
   php(236): WP_Filesystem_Base->search_for_folder(‘/home/customer/…’) #2 /home/
   customer/www/example.com/public_html/wp-admin/includes/class-wp-filesystem-base.
   php(57): WP_Filesystem_Base->find_folder(‘/home/customer/…’) #3 /home/customer/
   www/example.com/public_html/wp-content/plugins/sg-cachepress/core/Htaccess/Htaccess.
   php(105): WP_Filesystem_Base->abspath() #4 /home/customer/www/example.com/public_html/
   wp-content/plugins/sg-cachepress/core/Htaccess/Htaccess.php(81): SiteGround_Optimizer\
   Htaccess\Htaccess->set_htaccess_path() #5 /home/customer/www/example.com/public_html/
   wp-content/plugins/sg-cache in /home/customer/www/example.com/public_html/wp-
   admin/includes/class-wp-filesystem-ssh2.php on line 302

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Stanimir Stoyanov](https://wordpress.org/support/users/sstoqnov/)
 * (@sstoqnov)
 * SiteGround Representative
 * [4 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-ssh2_sftp_realpath/#post-14674635)
 * Hey [@willlettuce](https://wordpress.org/support/users/willlettuce/)
 * We were unable to reproduce the issue.
 * Would it be possible to send me your site url to [wpdevs@siteground.com](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-ssh2_sftp_realpath/wpdevs@siteground.com?output_format=md)?
 * Regards,
    Stanimir
 *  Thread Starter [willlettuce](https://wordpress.org/support/users/willlettuce/)
 * (@willlettuce)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-ssh2_sftp_realpath/#post-14676809)
 * Thanks! (sent)
 *  Plugin Author [Stanimir Stoyanov](https://wordpress.org/support/users/sstoqnov/)
 * (@sstoqnov)
 * SiteGround Representative
 * [4 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-ssh2_sftp_realpath/#post-14678846)
 * Hey [@willlettuce](https://wordpress.org/support/users/willlettuce/)
 * You have left over in your wp-config.php file from the SSH SFTP Updater Support
   plugin.
 * Please remove the lines added by this plugin and everything should work as expected.
 * Regards,
    Stanimir
 *  Thread Starter [willlettuce](https://wordpress.org/support/users/willlettuce/)
 * (@willlettuce)
 * [4 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-ssh2_sftp_realpath/#post-14682112)
 * Thanks so much for looking into this, Stanimir. I should have realized that.
 * Is it possible to force SFTP with this constant:
    define(‘FS_METHOD’, ‘ssh2’);
   while using SG Optimizer, or do I have to choose one or the other?
 * Thank you!
 *  Plugin Author [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * (@hristo-sg)
 * SiteGround Representative
 * [4 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-ssh2_sftp_realpath/#post-14687461)
 * This is not a SG Optiizer issue. Please, contact the developers of your SFTP 
   plugin for additional assistance.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘fatal error … Call to undefined function ssh2_sftp_realpath()’ is closed
to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [Hristo Pandjarov](https://wordpress.org/support/users/hristo-sg/)
 * Last activity: [4 years, 10 months ago](https://wordpress.org/support/topic/fatal-error-call-to-undefined-function-ssh2_sftp_realpath/#post-14687461)
 * Status: resolved