Skip to content
This repository was archived by the owner on Sep 12, 2022. It is now read-only.
This repository was archived by the owner on Sep 12, 2022. It is now read-only.

Permission denied on classPathCache.php #23

@Maikel-Koek

Description

@Maikel-Koek

Hello,

We ran into an issue on one of our clients' servers. After we run the Mage cron, all the pages stay blank, and lines like the following appear in our error_log:

[Tue Dec 02 09:34:38 2014] [error] [client 31.160.176.209] PHP Warning:  file_get_contents(/var/www/vhosts/ts-shops.nl/httpdocs/var/cache/classPathCache.php): failed to open stream: Permission denied in /var/www/vhosts/ts-shops.nl/httpdocs/.modman/Aoe_ClassPathCache/app/code/local/Varien/Autoload.php on line 164, referer: http://www.ts-shops.nl/index.php/admin/scheduler/index/key/24a06a7cd7b89deb8d0ed5a0c4fc042f/
[Tue Dec 02 09:34:39 2014] [error] [client 66.249.67.74] PHP Warning:  file_get_contents(/var/www/vhosts/ts-shops.nl/httpdocs/var/cache/classPathCache.php): failed to open stream: Permission denied in /var/www/vhosts/ts-shops.nl/httpdocs/.modman/Aoe_ClassPathCache/app/code/local/Varien/Autoload.php on line 164
[Tue Dec 02 09:34:41 2014] [error] [client 80.100.41.121] PHP Warning:  file_get_contents(/var/www/vhosts/ts-shops.nl/httpdocs/var/cache/classPathCache.php): failed to open stream: Permission denied in /var/www/vhosts/ts-shops.nl/httpdocs/.modman/Aoe_ClassPathCache/app/code/local/Varien/Autoload.php on line 164, referer: http://www.ts-shops.nl/index.php/admin/sales_order_create/index/key/35ebc65ff9cf18ac1eef94895619d61d/

When we delete the classPathCache.php file, all is well again.
We noticed that the file user and group changes when we run the cron.php file, and this has to be the cause of the errors (and thus the blank pages).

When created by calling a webpage:
-rw-rw-r--. 1 apache apache 148817 dec 2 10:42 classPathCache.php
When created after running cron.php:
-rw-rw-r--. 1 ts-83shop psacln 172K dec 2 10:32 classPathCache.php

I tried changing the file permissions to 0777 in app/code/local/Varien/Autoload.php (see below), but this didn't solve the problem.

...
                if (file_put_contents($tmpFile, $fileContent)) {
                    if (@rename($tmpFile, self::getCacheFilePath())) {
                        @chmod(self::getCacheFilePath(), 0777);
                    } else {
                        @unlink($tmpFile);
                    }
                }
...

How can we solve this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions