运行命令bin/magento deploy:mode:set production
时,进入部署静态内容部分时出现以下错误:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(2, 'PDOStatement::e...', '/var/www/mag...', 228, Array)
#1 /var/www/magento/testing_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#2 /var/www/magento/testing_html/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(93): Zend_Db_Statement_Pdo->_execute(Array)
#3 /var/www/magento/testing_html/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#4 /var/www/magento/testing_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#5 /var/www/magento/testing_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `main_ta...', Array)
#6 /var/www/magento/testing_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(533): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `main_ta...', Array)
#7 /var/www/magento/testing_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(605): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('SELECT `main_ta...', Array)
#8 /var/www/magento/testing_html/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(737): Magento\Framework\DB\Adapter\Pdo\Mysql->query(Object(Magento\Framework\DB\Select), Array)
#9 /var/www/magento/testing_html/vendor/magento/framework/Data/Collection/Db/FetchStrategy/Query.php(21): Zend_Db_Adapter_Abstract->fetchAll(Object(Magento\Framework\DB\Select), Array)
#10 /var/www/magento/testing_html/vendor/magento/framework/Data/Collection/AbstractDb.php(774): Magento\Framework\Data\Collection\Db\FetchStrategy\Query->fetchAll(Object(Magento\Framework\DB\Select), Array)
#11 /var/www/magento/testing_html/vendor/magento/framework/Data/Collection/AbstractDb.php(670): Magento\Framework\Data\Collection\AbstractDb->_fetchAll(Object(Magento\Framework\DB\Select))
#12 /var/www/magento/testing_html/vendor/magento/framework/Data/Collection/AbstractDb.php(574): Magento\Framework\Data\Collection\AbstractDb->getData()
#13 /var/www/magento/testing_html/vendor/magento/framework/Data/Collection/AbstractDb.php(559): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false)
#14 /var/www/magento/testing_html/vendor/magento/framework/Data/Collection.php(298): Magento\Framework\Data\Collection\AbstractDb->load()
#15 /var/www/magento/testing_html/vendor/magento/module-theme/Model/ResourceModel/Theme/Collection.php(141): Magento\Framework\Data\Collection->getFirstItem()
#16 /var/www/magento/testing_html/vendor/magento/module-theme/Model/Theme/ThemeProvider.php(92): Magento\Theme\Model\ResourceModel\Theme\Collection->getThemeByFullPath('frontend/Buzz/b...')
#17 /var/www/magento/testing_html/vendor/magento/framework/View/Asset/Repository.php(149): Magento\Theme\Model\Theme\ThemeProvider->getThemeByFullPath('frontend/Buzz/b...')
#18 /var/www/magento/testing_html/vendor/magento/framework/View/Asset/Repository.php(202): Magento\Framework\View\Asset\Repository->updateDesignParams(Array)
#19 /var/www/magento/testing_html/vendor/magento/module-deploy/Service/DeployStaticFile.php(87): Magento\Framework\View\Asset\Repository->createAsset('moment-timezone...', Array)
#20 /var/www/magento/testing_html/vendor/magento/module-deploy/Service/DeployPackage.php(189): Magento\Deploy\Service\DeployStaticFile->deployFile('moment-timezone...', Array)
#21 /var/www/magento/testing_html/vendor/magento/module-deploy/Service/DeployPackage.php(136): Magento\Deploy\Service\DeployPackage->processFile(Object(Magento\Deploy\Package\PackageFile), Object(Magento\Deploy\Package\Package))
#22 /var/www/magento/testing_html/vendor/magento/module-deploy/Service/DeployPackage.php(107): Magento\Deploy\Service\DeployPackage->deployEmulated(Object(Magento\Deploy\Package\Package), Array, false)
#23 [internal function]: Magento\Deploy\Service\DeployPackage->Magento\Deploy\Service\{closure}()
#24 /var/www/magento/testing_html/vendor/magento/framework/App/State.php(186): call_user_func_array(Object(Closure), Array)
#25 /var/www/magento/testing_html/vendor/magento/module-deploy/Service/DeployPackage.php(108): Magento\Framework\App\State->emulateAreaCode('frontend', Object(Closure))
#26 /var/www/magento/testing_html/vendor/magento/module-deploy/Process/Queue.php(300): Magento\Deploy\Service\DeployPackage->deploy(Object(Magento\Deploy\Package\Package), Array)
#27 /var/www/magento/testing_html/vendor/magento/module-deploy/Process/Queue.php(219): Magento\Deploy\Process\Queue->execute(Object(Magento\Deploy\Package\Package))
#28 /var/www/magento/testing_html/vendor/magento/module-deploy/Process/Queue.php(162): Magento\Deploy\Process\Queue->assertAndExecute('frontend/Buzz/b...', Array, Array)
#29 /var/www/magento/testing_html/vendor/magento/module-deploy/Strategy/QuickDeploy.php(76): Magento\Deploy\Process\Queue->process()
#30 /var/www/magento/testing_html/vendor/magento/module-deploy/Service/DeployStaticContent.php(109): Magento\Deploy\Strategy\QuickDeploy->deploy(Array)
#31 /var/www/magento/testing_html/setup/src/Magento/Setup/Console/Command/DeployStaticContentCommand.php(140): Magento\Deploy\Service\DeployStaticContent->deploy(Array)
#32 /var/www/magento/testing_html/vendor/symfony/console/Command/Command.php(241): Magento\Setup\Console\Command\DeployStaticContentCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Co
似乎可以继续设置生产模式并完成正常工作,但是在为一个自定义主题部署静态内容时,在信息中可以看到以下错误(但是,在设置max时,这似乎已经改变了。
此错误仅在我的生产服务器上显示,并且开发服务器似乎可以正常运行命令而没有任何问题。我尝试通过运行以下命令来更改 max_execution_time 和内存限制:
php -dmax_execution_time=-1 bin/magento deploy:mode:set production
还尝试了使用快速策略和标准策略手动部署静态内容,并且运行良好且没有任何错误,因此不确定从何处去?
奇怪的是,这在主服务器上花费的时间更长(1395秒/ 935秒),这是一台更好的机器。