I've a concrete5 running but suddenly the file upload appears not function as usual.
A couple of weeks ago the upload was working fine. then it stopped.
I've have checked the whole forum for similar issues but none of these are working.
The error message I get is:
Unable to copy file to storage directory. Please check permissions on your upload directory and ensure they can be written to by your web server.
and this is for multiple or single file uploads!
I've tried php5.ini containing
file_uploads = On upload_max_filesize = 32M post_max_size = 32M upload_tmp_dir = /tmp/
By the way I have tried the folder /temp/ with different file permission (777, 775, 755) including sub-folders and files. Nothing seems to work.
I've tried changing the directories "/file/" permission to 777 / 755 / 775 including sub-folders and files, result unsuccessful!
I've tried using the incoming folder via FileZilla = :(
I checked this discussions:
Did I miss something? Please anyone with another idea which could help solve this unusual problem?!
you should check that the directory concrete5 stores its file in is writable by the user the server runs (depending on your server).
thanks for your reply!
The file storage is usually "/file/" on the directory right?
If so I've checked it and it is writable!
you may want to investigate a bit more by adding some traces in the staging/concrete/core/libraries/file_importer.php file, in the storeFile() method (that's the one responsible for storing the file).
here's is the file_importer.php from:
concrete / core / libraries / file_importer.php
It there anything wrong?
<?php defined('C5_EXECUTE') or die("Access Denied."); Loader::model('file'); Loader::model('file_version'); /** * @package Core * @category Concrete * @author Andrew Embler <email@example.com> * @copyright Copyright (c) 2003-2009 Concrete5. (http://www.concrete5.org) * @license http://www.concrete5.org/license/... MIT License * */ /** * @package Core * @author Andrew Embler <firstname.lastname@example.org>
To debug this situation, you should modify the core code to add more messages about what is happenning and then fix the situation.
in the function storeFile, the line responsible for moving the uploaded file from /tmp to your final destination is this one :
$r = @copy($pointer, $path);
I would make it this way :
This code will create a '/tmp/store_trace.txt' file on the server, and print the relevant message to it.
After modifying the code, you will have more information to post here.
(Specifically, we will know from where to where was the copy, and what was the error code of the copy() call).
thanks for your support:
Now C5 logs this:
Trying to move /tmp/phpdgghOU to
pg resulted in return
In the Logs I also got "exceptions"
/var/www/vhosts/website.net/httpdocs/concrete/libraries/3rdparty/Zend/Cache.php:209 Could not determine temp directory, please specify a cache_dir manually (0)
Could it be related to each other?
BTW: the hosting is shared.
change the code to this :
The second message can be (is probably) related to your problem, it seems that for some reason c5 can not find a valid /tmp directory (that is a directory that is both readable and writable).
Are you 100% sure that the /tmp/ directory can be read by the user from which the server is running ?? and are you sure that the /tmp/ folder is not located on a full disk ?
constants info gives this output:
See also php-info.txt in attachment!
BTW: i've changed cache_dir in /concrete/libraries/3rdparty/Zend/Cache/Backend/File.php
to cache_dir:'/temp' after creating a folder in /concrete/temp with chmod 777
I've put the website to virtual hosting using EasyPHP 12.1 and the file upload works fine.
It might be that the hosting settings are wrong? Can that be reason?
If so, how can I check the settings?
The hosting company is domainexpress.co.uk
Services I got on this hosting are:
Apache ASP support No (Component was not installed)
SSI support No
PHP support Yes (PHP 'safe_mode' on)
CGI support Yes
Perl support No
Python support No (Component was not installed)
FastCGI support No
Miva support No (Component was not installed)
ColdFusion support No (Component was not installed)
Web statistics Webalizer (accessible via password protected directory '/plesk-stat/' )
Custom Error Documents No
I am not sure here, but AFAIK safe_mode prevents php to create files to some extents, that might be the problem.
Try disabling safe_mode (if you can), or enabling it on your virtual environment to reproduce it, and check again.
If that is not related, come back to my last post to update the tracing code I made you setup, so we can have the exact error.