Question

first thanks for your brilliant work on Restler, I am using it for some labs at the University and so far it works like a charm, really simple and elegant framework!

I've been using Restler 3.0 RC4 successfully until I updated to RC5 today. Now I'm having problems with the HtmlFormat. Whenever I try to access any of my web services that return HtmlFormat or try to enter the API Explorer, I'm getting a HTTP 500, "Unable to create cache directory /home/xxxxxxx/public_html/concrete/api/cache/php" . Also, I see a "Warning: mkdir() [function.mkdir]: No such file or directory in /home/xxxxxxx/public_html/concrete/Restler/vendor/Luracast/Restler/Format/HtmlFormat.php on line 367" .

Do you have any idea of what could be happening? In the upgrade, I just replaced my Restler framework folder with the RC5 one, without any changes in my API itself.

I would appreciate any help. Thank you!

Was it helpful?

Solution

Most of the template formats need a cache folder to keep their compiled files so that they run efficiently

Since RC5 we create a subfolder for the template type used. Even though php templates does not need compilation Restler attempts creating php folder under the default cache location, which is cache folder located in the same folder as the index.php

In your case it is

/home/xxxxxxx/public_html/concrete/api/cache

You should update the cache folder to keep it outside the web root by adding

Defaults::$cacheDirectory = '/home/xxxxxxx/cache';

And then make sure the cache folder is writable

Then HtmlFormat will create the php/twig/blade folder depending on your template preference and add the compiled files inside

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top