module-profiler icon indicating copy to clipboard operation
module-profiler copied to clipboard

Fatal error: Object of class \Magento\Framework\Profiler\Driver\Standard\Stat() could not be converted to string

Open olegf2a opened this issue 5 years ago • 1 comments

Fatal error appears function phpinfo() is used, function phpinfo() is used in the library for establishing a connection via SFTP. Library uses phpinfo() to check PHP settings. for example phpseclib\Crypt\RSA function __construct() { $this->configFile = dirname(__FILE__) . '/../openssl.cnf'; if (!defined('CRYPT_RSA_MODE')) { switch (true) { .... case extension_loaded('openssl') && file_exists($this->configFile): ... ob_start(); @phpinfo(); $content = ob_get_contents(); ob_end_clean();

fatal

olegf2a avatar Sep 18 '18 11:09 olegf2a

Work around could set MAGE_PROFILER_STAT to null before new RSA() etc. $_SERVER['MAGE_PROFILER_STAT'] = null;

Disabling Mirasvit Profiler module from Magento 2 did not appear to fix this.

bin/magento module:disable Mirasvit_Profiler

Removing it entirely did.

composer remove mirasvit/module-profiler

Unknown as to why it causes a crash when running @phpinfo from Magento cron job cli.

Related: https://github.com/phpseclib/phpseclib/issues/1400

LiamKarlMitchell avatar Sep 03 '19 05:09 LiamKarlMitchell