Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload error on XAMPP + SQLite #162

Open
GianlucaLocri opened this issue Jul 14, 2024 · 6 comments
Open

Upload error on XAMPP + SQLite #162

GianlucaLocri opened this issue Jul 14, 2024 · 6 comments

Comments

@GianlucaLocri
Copy link

GianlucaLocri commented Jul 14, 2024

Hi, new user here!
First of all thanks for this AMAZING work!
I'm trying to design my new site and before going live I've set up an xampp environment with sqlite as DB.
All is working correctly but as soon as I try to upload an image to the media folder I receive this message:
"Error
Error uploading! "

Can you help me to sort this out?

from xampp console:
Windows Version: Enterprise 64-bit
XAMPP Version: 8.2.12
Control Panel Version: 3.3.0

browser: 128.0 (64 bit) but tried also on Edge, same result.

Thanks!

@GianlucaLocri GianlucaLocri changed the title Upload error on Xampp + SQlite Upload error on XAMPP + SQLite Jul 14, 2024
@givanz
Copy link
Owner

givanz commented Jul 14, 2024

Hi

Thank you.

A common upload issue with XAMPP is a small 2MB limit for upload_max_filesize.

You can check the current value of Upload max filesize in admin > tools > system info https://demo.vvveb.com/admin/index.php?module=tools/systeminfo

To test if this is the cause try to upload a small image and see if it works.

You can increase upload_max_filesize by editing xampp's php.ini

Locate the Xampp folder and then open it. Inside the XAMPP folder, search for the php folder and then double click on it.
On the respective folder, search for the php.ini files. If you could find the file with the related name then open it.

https://www.thewindowsclub.com/increase-phpmyadmin-upload-size-on-xampp

You can also check php error log if there are any errors related to upload in admin > tools > error log
https://demo.vvveb.com/admin/index.php?module=tools/errorlog

@GianlucaLocri
Copy link
Author

Wow you are fast!
I've checked and my default setting for upload_max_filesize is 40M, also I was trying with very small files.
admin > tools > error log returned a PHP error log not readable, make sure that your log is properly configured and that is readable.

But I checked the log in \xampp\apache\logs\error.log and I found this two messages:
PHP Warning: move_uploaded_file(C:\\xampp\\htdocs\\public\\media\\\\public\\media\\hero.png): Failed to open stream: No such file or directory in C:\\xampp\\htdocs\\admin\\controller\\media\\media.php on line 133, referer: http://localhost/admin//index.php?module=editor/editor&url=/&template=index.html PHP Warning: move_uploaded_file(): Unable to move "C:\\xampp\\tmp\\php29CA.tmp" to "C:\\xampp\\htdocs\\public\\media\\\\public\\media\\hero.png" in C:\\xampp\\htdocs\\admin\\controller\\media\\media.php on line 133, referer: http://localhost/admin//index.php?module=editor/editor&url=/&template=index.html

@givanz
Copy link
Owner

givanz commented Jul 14, 2024

Thanks for pasting the error message.

I found some media code that didn't work with windows path separator.

I changed the code to work on windows also, please redownload latest.zip and update admin/controller/media/media.php.

@GianlucaLocri
Copy link
Author

Thanks again for the quick support, but unfortuntely I've updated the file, restarted xampp, cleared firefox cache, etc, but I've got the same error...
I've also tried to clear the vvveb cache and just to be sure I've verified that I'm using the corrected file (I see a single modification at line 72 that now is $path = preg_replace('@^[\/]public[\/]media|^[\/]media|^[\/]public@', '', $path);)

@givanz
Copy link
Owner

givanz commented Jul 14, 2024

Only line 72 was changed to work for windows path format.
I think it's still wrong, can you please change line 72 to

$path      = preg_replace('@^[\\\/]public[\\\/]media|^[\\\/]media|^[\\\/]public@', '', $path);

If it still doesn't work please check error.log and see if it's the same error message or something different.

@GianlucaLocri
Copy link
Author

YEAH That's it! Now it works flawlessly!
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants