Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working with blade templating within a limited hosting environment

I am working on a project that uses blade templating for a custom wordpress website. The website is hosted on wpengine - which has lots of limitations and prevents from creating files / writing files on the fly which is required by the blade templating engine, no command line access, etc.

My temporary course of action to get new features deployed, was simply to ftp the cache files from my local environment to the server, however, doing so result in the following errors, which ignore the cache files on the server and attempt to reference cache files that no longer exist:

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 33

Warning: 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 43

Warning: 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

Note, I don't have access to: /opt/nas/www/common/production/php_prevent_flock.php

Was wondering why blade is looking to reference old cache files? How can I prevent this? Is there an easier way to deploy new blade templates despite wpengine limitations?

like image 266
AnchovyLegend Avatar asked Oct 18 '22 04:10

AnchovyLegend


1 Answers

I also had this problem , the solution was very simple , just change the path of the cache folder, keep its path as

/tmp/cache

this is because Wpengine allows caches to be stored in tmp folder that should be placed at the root

like image 101
aneet Avatar answered Nov 15 '22 09:11

aneet