We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Localhost can not upload image

How Do I?

Ngon Com's avatar
Ngon Com
14 posts
5 years ago
Ngon Com's avatar Ngon Com

Hi,

I run website on localhost using XAMPP, I create upload folder with these settings:

  • Upload url: {base_url}uploads/ (base_url = http://bac.com/)
  • Upload path: {base_path}uploads/ (base_path= C:/xampp/htdocs/bac.com/)

Upload file as text, pdf ok but when upload image, it notice:

Cannot Upload File

Thumbnail could not be created for the image. Please make sure the thumbnail directory is writable.

It create “_thumbs” folder inside “uploads” folder but not upload image.

Is it problem because folder’s atrributes is read-only? Because I can’t change this after save.

Thank!

P/S: EE 2 with PHP 5 working, but EE 5.2.6 with PHP 7.3.9 not working.

       
aquicksharp's avatar
aquicksharp
28 posts
5 years ago
aquicksharp's avatar aquicksharp

Windows file permissions for lamp settings can be really tricky. First off make sure you are running xamp with administrator privileges , easiest way is to right click on the short cut and choose run as administrator .

Then right click on your images folder and select properties , then go to security and check that your user or group has full permissions allowed for that folder .If it doesn’t edit it and give full permissions. All of this is dependent on you having full admin rights to the computer

       
Ngon Com's avatar
Ngon Com
14 posts
5 years ago
Ngon Com's avatar Ngon Com

Thank for your reply!

  • Run as administrator XAMPP - OK
  • Change permission for folder with all user group - OK

But it still not working!

I notice that: run EE 2.11.9 with PHP 5 works well, so I think this problem is in EE 5 itself (except upload avatar, it works properly).

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

Check your error logs- you might be hitting memory limits or some such. And have you run the server wizard on that environment? GD is required, so it might be something along those lines.

       
Ngon Com's avatar
Ngon Com
14 posts
5 years ago
Ngon Com's avatar Ngon Com

Hi,

I only upload a small image (~200Kb), server wizard ok and GD enable.

It is strange when EE 2.11.9 working ok (with PHP 5).

       
Robin Sowell's avatar
Robin Sowell
13,158 posts
5 years ago
Robin Sowell's avatar Robin Sowell

If you can upload a small image but not a larger one, it’s highly likely it’s a server setting. Either allowed upload size, memory, allowed post size- something along those lines.

So- make sure you have plenty of php memory- check in phpinfo in the control panel (utilities- PHP info). I go at least 256, my local is on 500.

Also check: upload_max_filesize and post_max_size.

It really sounds like that’s the problem if you can upload smaller files.

       
Ngon Com's avatar
Ngon Com
14 posts
5 years ago
Ngon Com's avatar Ngon Com

I have post_max_size=8M, upload_max_filesize=200M in php.ini; but nothing change!

Have you try install XAMPP on win 10?

       
Andrés Molina's avatar
Andrés Molina
43 posts
5 years ago
Andrés Molina's avatar Andrés Molina

check timeout in your php.ini

max_execution_time=0 max_input_time=-1 memory_limit=628M (its a example im have free 4GB and set this)

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.