使用Surf成功部署TYPO3项目后的操作码缓存

时间:2016-11-22 16:09:34

标签: typo3 typo3-6.2.x

我正在部署一个TYPO3 6.2项目与(当前大师)Surf。安装了EXT:typo3_console(1.1.8)和EXT:coreapi(1.3.0)(在最新的兼容版本中)并在TYPO3项目中激活。

不幸的是,在浏览器中请求成功部署的项目时出现错误:

Fatal error: Cannot redeclare class tx_pdfcreator2 in /var/www/vhosts/preview/htdocs/releases/20161122165450/Web/typo3conf/ext/pdf_creator2/class.tx_pdfcreator2.php on line 37

在TYPO3的安装工具中清除操作码缓存后,TYPO3实例再次运行。

通过EXT:coreapi清除操作码缓存并不能解决问题,尽管控制台上的输出是"完整的操作码缓存已被清除"。

这是Surf生成的输出:

Deploying preview (20161122165450)
Stage initialize
Webserver 001 (Project_001) TYPO3\Surf\Task\CreateDirectoriesTask
Webserver 001 (Project_001) TYPO3\Surf\Task\Generic\CreateDirectoriesTask
Stage package
Webserver 001 (Project_001) TYPO3\Surf\Task\Package\GitTask
Webserver 001 (Project_001) Foo\Deployment\Task\LocalInstallTask
Stage transfer
Webserver 001 (Project_001) TYPO3\Surf\Task\Transfer\RsyncTask
Webserver 001 (Project_001) TYPO3\Surf\Task\Generic\CreateSymlinksTask
Webserver 001 (Project_001) TYPO3\Surf\Task\TYPO3\CMS\CreatePackageStatesTask
Stage update
Webserver 001 (Project_001) TYPO3\Surf\Task\TYPO3\CMS\SymlinkDataTask
Webserver 001 (Project_001) TYPO3\Surf\Task\TYPO3\CMS\CopyConfigurationTask
Stage migrate
Webserver 001 (Project_001) TYPO3\Surf\Task\TYPO3\CMS\SetUpExtensionsTask
Webserver 001 (Project_001) TYPO3\Surf\Task\TYPO3\CMS\CompareDatabaseTask
Stage finalize
Stage test
Stage switch
Webserver 001 (Project_001) TYPO3\Surf\Task\SymlinkReleaseTask
Node "Webserver 001" is live!
Webserver 001 (Project_001) TYPO3\Surf\Task\TYPO3\CMS\FlushCachesTask
Stage cleanup
Webserver 001 (Project_001) TYPO3\Surf\Task\CleanupReleasesTask
Removing releases 20161117180245

知道这里出了什么问题以及如何解决问题?

2 个答案:

答案 0 :(得分:3)

要清除带冲浪的操作码缓存,您需要将WebOpcacheResetCreateScriptTask和WebOpcacheResetExecuteTask任务添加到工作流程中。

使用coreapi清除cli上的操作码缓存无效。有关详细的表达,请参阅http://insight.helhum.io/post/142295674970/what-you-need-to-know-about-php-opcode-cache

答案 1 :(得分:1)

使用冲浪任务\TYPO3\Surf\Task\Php\WebOpcacheResetCreateScriptTask\TYPO3\Surf\Task\Php\WebOpcacheResetExecuteTask(与Surf一起提供)代替EXT:coreapi为我工作!

$workflow->addTask(WebOpcacheResetCreateScriptTask::class, 'package', $this);
$workflow->addTask(WebOpcacheResetExecuteTask::class, 'switch', $this);