mirasvit / module-profiler

Magento 2 Profiler
https://mirasvit.com/
Open Software License 3.0
133 stars 36 forks source link

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

Open olegf2a opened 6 years ago

olegf2a commented 6 years ago

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

LiamKarlMitchell commented 5 years ago

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