php – 在有限的托管环境中使用刀片模板
作者:互联网
我正在开发一个项目,使用刀片模板为自定义wordpress网站.该网站托管在wpengine上 – 它有很多限制,可以防止创建文件/写入文件,这是刀片模板引擎所需要的,无需命令行访问等.
部署新功能的临时措施只是将缓存文件从本地环境ftp到服务器,但这样做会导致以下错误,这些错误会忽略服务器上的缓存文件并尝试引用缓存文件不再存在:
Warning:
file_put_contents(/nas/content/live/mypath/wp-content/plugins/pluginname/Classes/Controllers/../../views/cache/e44b26a14bd95cd0cdf764d863a0b4bd1848c8ba.php):
failed to open stream: Permission denied in
/opt/nas/www/common/production/php_prevent_flock.php on line 33Warning:
include(/nas/content/live/mypath/wp-content/plugins/pluginname/Classes/Controllers/../../views/cache/e44b26a14bd95cd0cdf764d863a0b4bd1848c8ba.php):
failed to open stream: No such file or directory in
/nas/content/live/mypath/wp-content/plugins/pluginname/vendor/illuminate/view/Engines/PhpEngine.php
on line 43Warning: include(): Failed opening
‘/nas/content/live/mypath/wp-content/plugins/pluginname/Classes/Controllers/../../views/cache/e44b26a14bd95cd0cdf764d863a0b4bd1848c8ba.php’
for inclusion (include_path=’.:/usr/share/php’) in
/nas/content/live/mypath/wp-content/plugins/pluginname/vendor/illuminate/view/Engines/PhpEngine.php
on line 43
注意,我无权访问:/opt/nas/www/common/production/php_prevent_flock.php
想知道为什么刀片服务器想要引用旧的缓存文件?我怎么能阻止这个?尽管存在wpengine限制,是否有更简单的方法来部署新的刀片模板?
解决方法:
我也有这个问题,解决方案很简单,只需更改缓存文件夹的路径,保持其路径为
/tmp/cache
这是因为Wpengine允许将缓存存储在应放在根目录的tmp文件夹中
标签:wordpress,php,laravel,templating,blade 来源: https://codeday.me/bug/20190627/1305904.html