Upload Error
Permalink
Hi everyone,
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
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:
http://www.concrete5.org/community/forums/block_requests/upload-fil...
http://www.concrete5.org/community/forums/installation/solved-uploa...
Did I miss something? Please anyone with another idea which could help solve this unusual problem?!
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:
http://www.concrete5.org/community/forums/block_requests/upload-fil...
http://www.concrete5.org/community/forums/installation/solved-uploa...
Did I miss something? Please anyone with another idea which could help solve this unusual problem?!
Hi goutnet,
thanks for your reply!
The file storage is usually "/file/" on the directory right?
If so I've checked it and it is writable!
thanks for your reply!
The file storage is usually "/file/" on the directory right?
If so I've checked it and it is writable!
did you check if the disk is not full ?
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).
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).
Hi goutnet,
here's is the file_importer.php from:
concrete / core / libraries / file_importer.php
It there anything wrong?
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 <andrew@concrete5.org> * @copyright Copyright (c) 2003-2009 Concrete5. (http://www.concrete5.org) * @license http://www.concrete5.org/license/... MIT License * */ /** * @package Core * @author Andrew Embler <andrew@concrete5.org>
Viewing 15 lines of 134 lines. View entire code block.
No, I meant you should add some traces here and there to see why the file can not be written ...
I dont get you?!
Well, I am making a wild guess here, but sounds like you are not a coder are you ? :P
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 :
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).
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).
You may find the code snippets in this howto of use for debugging:
http://www.concrete5.org/documentation/how-tos/developers/concrete5...
http://www.concrete5.org/documentation/how-tos/developers/concrete5...
Hi,
thanks for your support:
Now C5 logs this:
Trying to move /tmp/phpdgghOU to
/var/www/vhosts/website.net/httpdocs/files/4013/6094/6267/picture.j
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.
thanks for your support:
Now C5 logs this:
Trying to move /tmp/phpdgghOU to
/var/www/vhosts/website.net/httpdocs/files/4013/6094/6267/picture.j
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.
Well, so that's the copy function which is failing.
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 ?
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 ?
If you install the 'constants info' and 'php info' addons (both free), that will enable you to track down what php and concrete both think the temp directory is.
Hi,
constants info gives this output:
DIR_FILES_UPLOADED /var/www/vhosts/website.net/httpdocs/files
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
constants info gives this output:
DIR_FILES_UPLOADED /var/www/vhosts/website.net/httpdocs/files
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
Hi,
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'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 familiar with this host, but that is most likely the case.
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.
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.
you should check that the directory concrete5 stores its file in is writable by the user the server runs (depending on your server).