TurnKey Linux Virtual Appliance Library

lamp: tring to use web page to upload a file and dir is locked cant upload...

ridinglowest's picture

I have tested a web page on both lamp and on my windows machine with xampp and this is just a basic web page that will take a file and upload it to the directory. On lamp it dosent work..

Is there something I have to do with the webmin to allow for file uploads via a webpage?

I looked all over apache and in th ssh and I cant find anything..

I have done some configuration I wonder if I deleted something..

please help.

Jeremy Davis's picture

I have noticed some similar

I have noticed some similar behaviour and have found a workaround (that worked for me at least).

Using Webmin - navigate to Tools>File Manager. Assuming that the dir that your webpage uploads to has no other files (if it does make a 'public' subdirectory). Click the dir in the right pane. click Info button (top row). Adjust the permissions to 0777 and "This folder and its files" (from the "Apply changes to" dropdown).

I know this is not ideal but it solved my problems. I'm not sure why this is a problem, perhaps it is to do with the hardened nature of the Turnkey LAMP?
Jeremy Selph's picture

it worked...

I just had to apply the chnages to its dir and files, but it did work thank you..
Alon Swartz's picture

The webserver user needs the approriate permissions

The php code is running under the webserver context (www-data), so it needs to have write access to the folder you want to save files to, for example:
chown www-data:www-data /var/www/uploads
Jeremy Davis's picture


Thanks for that, sounds like that should do the trick. [edit] That worked beautifully, thanks.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)