Skip to content

PLEASE CREATE OR CHMOD /cache/mysite.de/Files - 0777 OR ANY WRITABLE PERMISSION! #441

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Pansa237 opened this issue Mar 15, 2017 · 8 comments
Assignees
Labels

Comments

@Pansa237
Copy link

Configuration:

PhpFastCache version: Latest release, 6.0.0-rc2, 6bfaa5d, Verified, 6.0.0-rc2 Release
PHP version: 7.0.16
Operating system: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux

Issue description:

I get the following error, although cache /cache/mysite.de/Files has chmod 777 (also recursively);

Fatal error: Uncaught phpFastCache\Exceptions\phpFastCacheIOException: PLEASE CREATE OR CHMOD /cache/mysite.de/Files - 0777 OR ANY WRITABLE PERMISSION! in
/homepages/20/d570100808/htdocs/mysite/html/traffic-includes/3rdparty/phpfastcache-final/src/phpFastCache/Core/Pool/IO/IOHelperTrait.php:122 Stack trace: #0
/homepages/20/d570100808/htdocs/mysite/html/traffic-includes/3rdparty/phpfastcache-final/src/phpFastCache/Drivers/Files/Driver.php(58): phpFastCache\Drivers\Files\Driver->getPath() #1
/homepages/20/d570100808/htdocs/mysite/html/traffic-includes/3rdparty/phpfastcache-final/src/phpFastCache/Drivers/Files/Driver.php(48): phpFastCache\Drivers\Files\Driver->driverCheck() #2
/homepages/20/d570100808/htdocs/mysite/html/traffic-includes/3rdparty/phpfastcache-final/src/phpFastCache/CacheManager.php(195): phpFastCache\Drivers\Files\Driver->__construct(Array) #3
/homepages/20/d570100808/htdocs/mysite/html/traffic-includes/api_functions.php(31): phpFastCache\CacheManager::getInstance('Files') in
/homepages/20/d570100808/htdocs/mysite/html/traffic-includes/3rdparty/phpfastcache-final/src/phpFastCache/Core/Pool/IO/IOHelperTrait.php on line 122

I integrate phpfastcache like this:

require_once("3rdparty/phpfastcache-final/src/autoload.php");
use phpFastCache\CacheManager;
CacheManager::setDefaultConfig(array(
"path" => 'cache'
));

It works on my local dev system (XAMPP Version 7.0.8), but not on the live system hosted by 1and1.

@Geolim4
Copy link
Member

Geolim4 commented Mar 15, 2017

Hello,

You may have another issue: The Webserver is not allowed to write on the directory that belong to your user (root or something else).

You may need to perform a chown to give the transfer the directory to another user.

Cheers,
Georges

@Geolim4 Geolim4 self-assigned this Mar 15, 2017
@Geolim4 Geolim4 added the 6.0 label Mar 15, 2017
@Pansa237
Copy link
Author

Hi,

I don't think that is the problem.

Phpfastcache scripts do successfully create subfolders in my "cache" directory ("cache/mysite.de/Files") and they also successfully create a .htaccess file in the " /cache/mysite.de/Files" directory to which the error message says it can't write to, because of missing write permissions.

Cheers,
Michael

@Geolim4
Copy link
Member

Geolim4 commented Mar 15, 2017

Can you try to create the file automatically using an external php script that you call from the webserver ?
It looks really like a server misconfiguration to me as the latest build successfully passes :/

@Pansa237
Copy link
Author

Sorry, don't know what you mean by "create the file" - what file?

Scripts and folders to write to all have the same owner/group - and like I said, scripts do really creat subfolders and a .htaccess file - just the cache files cannot be created...

unbenannt
unbenannt1

@Geolim4
Copy link
Member

Geolim4 commented Mar 15, 2017

Do you have enough free space on the disk ?
Also please specify an absolute path on the "path" config :)

@Pansa237
Copy link
Author

Disc space is more than sufficient.

Absolute path (dir."/cache") helped - can you update your error message there? It is very misleading and cost me quite some time...
Especially as relative path worked in my local dev system.

Thanks!

@quamis
Copy link

quamis commented Mar 16, 2017

Had the same problem. The error message is indeed misleading when relative paths are used.

@Geolim4
Copy link
Member

Geolim4 commented Mar 16, 2017

Done, the exception now throw a more descriptive message :)

Cheers,
Georges

@Geolim4 Geolim4 closed this as completed Mar 16, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants