Forum

Unable to upload lo...
 
Notifications
Clear all

Unable to upload logo image: Unable to write to:/support/osta/uploads/

12 Posts
4 Users
0 Reactions
51 Views
Posts: 1177
Admin
(@stevland)
Member
Joined: 2 months ago

@mayberts,

Please check your Apache error logs for relevant errors around the time that you attempt to upload a file. Let me know.

In addition to setting the upload directory permissions to 755, please verify that the directory owner is the same account that your main website runs under.

On my system it looks like this

# cd osta
# ls -l
drwxr-xr-x. 3 osticketawesome psacln 4096 May 23 20:16 css
drwxr-xr-x. 3 osticketawesome psacln 4096 May 23 20:16 icons
drwxr-xr-x. 4 osticketawesome psacln 4096 May 23 20:16 img
drwxr-xr-x. 2 osticketawesome psacln 4096 May 23 20:16 inc
drwxr-xr-x. 3 osticketawesome psacln 4096 May 23 20:16 js
drwxr-xr-x. 5 osticketawesome psacln 4096 May 23 20:16 opt
drwxr-xr-x. 2 osticketawesome psacln 4096 May 23 20:16 php
drwxr-xr-x. 3 osticketawesome psacln 4096 May 23 20:16 svg
drwxr-xr-x. 2 osticketawesome psacln 4096 Jul 13 23:20 uploads
-rw-r--r--. 1 osticketawesome psacln 198 Dec 17 2019 user-scripts.js
-rw-r--r--. 1 osticketawesome psacln 276 May 23 20:38 user-styles.css
-rw-r--r--. 1 osticketawesome psacln 27 May 23 20:18 version.txt

In my case the owner of the uploads directory is osticketawesome, which is the account that my website runs under. And psacln is the group that the account belongs to.

If you uploaded the files as another user (for example, as root), that would explain your issue.

What do you see when you use the ls -l command?


Reply
Posts: 6
Topic starter
(@mayberts)
Member
Joined: 6 years ago

this is what mine look like,  I will check Apache logs now

drwxr-xr-x 3 mdadmin mdadmin 4096 Jul 8 19:33 css
drwxr-xr-x 3 mdadmin mdadmin 4096 Jun 6 14:22 icons
drwxr-xr-x 4 mdadmin mdadmin 4096 Jun 6 14:22 img
drwxr-xr-x 2 mdadmin mdadmin 4096 Jun 6 14:22 inc
drwxr-xr-x 3 mdadmin mdadmin 4096 Jun 6 14:22 js
drwxr-xr-x 5 mdadmin mdadmin 4096 Jun 6 14:22 opt
drwxr-xr-x 2 mdadmin mdadmin 4096 Jun 6 14:22 php
drwxr-xr-x 3 mdadmin mdadmin 4096 Jun 6 14:22 svg
drwxr-xr-x 2 mdadmin mdadmin 4096 Jun 8 11:09 uploads
-rw-r--r-- 1 mdadmin mdadmin 198 Jun 6 14:05 user-scripts.js
-rw-r--r-- 1 mdadmin mdadmin 267 Jun 6 15:32 user-styles.css
-rw-r--r-- 1 mdadmin mdadmin 27 Jun 6 14:05 version.txt


Reply
Posts: 6
Topic starter
(@mayberts)
Member
Joined: 6 years ago

Apache error log.

PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpQHnhJe' to '/var/www/tickets/osta/uploads/Logo.png' in /var/www/tickets/osta/php/functions.php on line 141, refere$


Reply
Posts: 1177
Admin
(@stevland)
Member
Joined: 2 months ago

@mayberts,

drwxr-xr-x 2 mdadmin mdadmin 4096 Jun 8 11:09 uploads

So your uploads folder is owned by the mdadmin account.

If you run the ls -l command in the root directory of your main website, are those files also owned by mdadmin?


Reply
Posts: 1177
Admin
(@stevland)
Member
Joined: 2 months ago

@mayberts,

PHP Warning: move_uploaded_file(): Unable to move

That error does seem specifically related to an ownership/ permissions issue. Your permissions seem fine, so it must be something to do with ownership.

See this link:
https://stackoverflow.com/questions/13723174/php-warning-move-uploaded-file-unable-to-move

Actually, it may be a Ubuntu thing. It may help to set the user and group to www-data. I have found a few search results where this worked for Ubuntu users:

# chown -R www-data:www-data /path/to/uploads


Reply
Page 2 / 3
Share: