MichaelEZ Posted October 15, 2019 Posted October 15, 2019 Hi, after transfer from PS to TB i v got some errors, at first i did not notice, but when i wanted try out build in TB cache system - it crashed. But even with dev mode ON a only see this error when cache is on : [ThirtyBeesException] Unknown resource type ' But after turning off build in TB cache system - different errors catch my sight - those pop up [dunno how i didnt notice before]: /web/classes/Tools.php on line 1317 - > line -> trigger_error($error, E_USER_WARNING); protected static function throwDeprecated($error, $message, $class) { if (_PS_DISPLAY_COMPATIBILITY_WARNING_) { trigger_error($error, E_USER_WARNING); Logger::addLog($message, 3, $class); } } Warning: Invalid argument supplied for foreach() in /web/classes/Dispatcher.php on line 519 - > line -> foreach ($moduleRoute as $route => $routeDetails) { protected function loadRoutes($idShop = null) { // Load custom routes from modules $modulesRoutes = Hook::exec('moduleRoutes', ['id_shop' => $idShop], null, true, false); if (is_array($modulesRoutes) && count($modulesRoutes)) { foreach ($modulesRoutes as $moduleRoute) { foreach ($moduleRoute as $route => $routeDetails) { if (array_key_exists('controller', $routeDetails) && array_key_exists('rule', $routeDetails) && array_key_exists('keywords', $routeDetails) && array_key_exists('params', $routeDetails) ) { if (!isset($this->default_routes[$route])) { $this->default_routes[$route] = []; } $this->default_routes[$route] = array_merge($this->default_routes[$route], $routeDetails); } } } } Warning on the row 1647 /controllers/admin/AdminPerformanceController.php [2] Zend OPcache API is restricted by "restrict_api" configuration directive - > line -> opcache_invalidate(_PS_ROOT_DIR_.'/config/defines.inc.php'); if (function_exists('opcache_invalidate')) { opcache_invalidate(_PS_ROOT_DIR_.'/config/defines.inc.php'); } Warning on the row 132 /classes/PrestaShopAutoload.php [2] Zend OPcache API is restricted by "restrict_api" configuration directive - > line -> opcache_invalidate($filenameTmp); // Write classes index on disc to cache it $filename = $this->normalizeDirectory(_PS_ROOT_DIR_).PrestaShopAutoload::INDEX_FILE; $filenameTmp = tempnam(dirname($filename), basename($filename.'.')); if ($filenameTmp !== false && file_put_contents($filenameTmp, $content) !== false) { if (!@rename($filenameTmp, $filename)) { unlink($filenameTmp); } else { @chmod($filename, 0666); if (function_exists('opcache_invalidate')) { opcache_invalidate($filenameTmp); } } } // $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), no need to die. else { Tools::error_log('Cannot write temporary file '.$filenameTmp); } So I woud rather solve those, or atleast gain some intel on them - are they harmful? Runnin on thirty bees version: 1.0.8
datakick Posted October 15, 2019 Posted October 15, 2019 38 minutes ago, MichaelEZ said: /web/classes/Tools.php on line 1317 - > line -> trigger_error($error, E_USER_WARNING); Not relevant. You have enabled compatibility warnings, so all usage of deprecated methods are reported. To get rid of these, remove define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true); from your /config/defines_custom.inc.php or /config/defines.inc.php files 38 minutes ago, MichaelEZ said: Warning: Invalid argument supplied for foreach() in / web/classes/Dispatcher.php on line 519 - > line -> foreach ($moduleRoute as $route => $routeDetails) { Not core issue. You have installed some module that registered hookModuleRoutes hook, but the hook did not return array. You will need to fix that module 38 minutes ago, MichaelEZ said: Warning on the row 1647 /controllers/admin/AdminPerformanceController.php [2] Zend OPcache API is restricted by "restrict_api" configuration directive - > line -> opcache_invalidate(_PS_ROOT_DIR_.'/config/defines.inc.php'); .... Warning on the row 132 /classes/PrestaShopAutoload.php [2] Zend OPcache API is restricted by "restrict_api" configuration directive - > line -> opcache_invalidate($filenameTmp); Looks like server settings issue -- its not possible to invalidate opcache. Talk to your hosting provider and ask why is OPcache api restricted. 1
MichaelEZ Posted October 15, 2019 Author Posted October 15, 2019 Was thinking same about 1st, i googled opcache - it is often forbidden .. " I own a hosting company and many of my clients complain about this error. I can not remove the opcache restriction for obvious security reasons. Could not you hide this alert? " At hosting provider panel i can turn off/on opcache (PHP 5.4+, 7.x) - [turned on] Thanks for quick reply
datakick Posted October 15, 2019 Posted October 15, 2019 It's ok if opcache extension is forbidden -- every usage in the core is conditional, there's a check that this functionality exists if (function_exists('opcache_invalidate')) { ... } The problem here is that it exists, but is crippled by some security restriction. That's weird. If thirtybees can't invalidate opcache entries, and opcache is actually in use, that might cause strange errors during code updates, as your server might still effectively use old version of php files.
MichaelEZ Posted October 15, 2019 Author Posted October 15, 2019 (edited) So i better contact them about it. I have one more Q, we have problem with modules like bestsellet, news etc on homepage, they took 7 s to load, even when theres is only few products.. We bought new theme - new modules on homepage but loading time is still big, yet on category, product page it okay-ish. We had problem with slow queries, somehow we manage to fix that. I cleared whole DB from 1gb to 300mb but still its slow as it was before. Also I´m unable to support TB : There was an error processing the payment. Please try a different payment method or contact us for assistance. All datas inpet were right. I own Visa cart. // so hosting prov. replied back sayin thats its forbidden on shared hosting, and so i shoud ho for VPS. Well theirs VPS prices are 🤢 🤮 Edited October 15, 2019 by MichaelEZ
datakick Posted October 15, 2019 Posted October 15, 2019 58 minutes ago, MichaelEZ said: So i better contact them about it. I have one more Q, we have problem with modules like bestsellet, news etc on homepage, they took 7 s to load, even when theres is only few products.. We bought new theme - new modules on homepage but loading time is still big, yet on category, product page it okay-ish. We had problem with slow queries, somehow we manage to fix that. I cleared whole DB from 1gb to 300mb but still its slow as it was before. Enable Advanced Parameters > Performance > Profiling. This should tell you where the bottlenecks are. 58 minutes ago, MichaelEZ said: Also I´m unable to support TB : There was an error processing the payment. Please try a different payment method or contact us for assistance. All datas inpet were right. I own Visa cart. @lesley could you look into that?
MichaelEZ Posted October 15, 2019 Author Posted October 15, 2019 Gonna do that, hopefully some new clues will appears, one more Q, I dont want to start new topic. Shoud i go for TB build in cache system or is there paid option? Currently im tryin xtreme cache, seems to be working but only sometimes, once it load under 2sec but that again around 5sec.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now