php - Unable to write cache file

470

I have a problem on a project that i took back. There is a problem with the right ( i think ) forwww-data; I'm on a sf 2.0 project and the error comes too on other (working and in production ) website..

So i followed the official symfony docs: http://symfony.com/doc/2.0/book/installation.html

The three solutions have been tried with success, the setfacl are working, but there is still the error when i'm trying to clear the cache.

The project is working, and there is no problem with it on the server.

Even theumask(0000) still does nothing !

I really don't know where and what to find.. Any help ?

211

Answer

Solution:

Well, here is the solution:

I don't understand the -3 but ok. As i said, i search for the solution, and follow the documentation here: http://symfony.com/doc/2.0/book/installation.html

www-data had the rights but i still getting the error.

I deployed the project again and i didphp app/check.php

Then i got this error:

[[ ERROR ]] Checking that the "date.timezone" setting is set: FAILED
        *** Set the "date.timezone" setting in php.ini (like Europe/Paris) ***

Then

sudo mv /etc/php5/cli/php.ini /etc/php5/cli/php.ini.bak
sudo ln -s /etc/php5/apache2/php.ini /etc/php5/cli/php.ini

Then i gave a value todate.timezone and all worked fine with a newphp app/check.php

Problem solved !

297

Answer

Solution:

Make sure the Apache user in your system is calledwww-data. If it has any other name likewww orapache, change permissions withsetfacl orchmod +a accordingly.

Also, deleteapp/cache andapp/logs folders content manually with the following command:

rm -rf app/cache/* app/logs/*

People are also looking for solutions to the problem: php - Query execution speed when finding SUM

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.