Websites on Nginx Server Cannot Upload Images
Often Asked Question
- Full general questions
- Which browsers are supported?
- Which file formats are supported?
- What is new?
- How can I hands contact the LycheeOrg system?
- How can I set thumbnails for my albums?
- Is it possible to create folders inside another folder? If so, how to practice that?
- What headers need to be used to authenticate with the custom api_key in the settings?
- Tin can I apply my existing folder structure?
- Can I upload videos?
- Is it possible to create multiple users?
- Does Lychee use ImageMagick?
- How to change the championship of the site?
- How to reset username and password?
- How to hide smart albums?
- How to disable the 'zoom' animation while browsing pictures?
- How is the upload folder protected?
- My login is timing out after two hours, how can this be inverse?
- How can I clear the Logs?
- How can I see the correct client IP address when running Lychee behind Cloudflare?]
- Tin I set upward Lychee to sentry a folder for new images and automatically add together them to albums?
- Special right-click menu doesn't announced for new users?
- Installation, migration, upgrade, update
- How can I install Lychee without SSH admission?
- How practice I upgrade from Lychee v3 to Lychee v4?
- How tin can I back up my installation?
- How can I drift my installation to a new host?
- Can I host Lychee with a subpath with Nginx? Like https://example.dev/lychee/
- Tin can I host Lychee with a subpath with Apache? Like https://example.dev/lychee/
- Do we really need writable app/?
- Is information technology possible to do the update directly from the GUI? How?
- Can I drift from a 64-fleck system to a 32-bit system?
- Why tin can't I come across the cheque for update push in the GUI?
- How tin can I end artisan migrate and composer from running afterwards every git pull?
- Problems
- Lychee is not working
- When I practice X, I get an error api not institute, what can I practice?
- I have an error 404 and I'thousand using Apache, what tin can I practise?
- I take an error 404 and I'g using Nginx, what can I practise?
- I take an error 404 and I'm using php -S, what can I exercise?
- I take an fault 500, what tin I do?
- I take an errror 419 in the Network tab, what is going on?
- I can't upload (big) photos.
- What does Upstream sent too large header error message hateful?
- Why don't my videos accept thumbnails?
- Composer can't create a cache directory
- I can't access the users under settings server fault or api not found on Lightspeed
- I know my file permissions for storage, bootstrap/cache, public/uploads, and public/dist are correct and accessible by my spider web server user, but I'yard still getting a PHP error when writing to any of these directories.
- I know port fourscore/443 are open on my machine, only Lychee/my server is even so refusing all connections.
- I know my SQL database is setup correctly, merely Lychee is showing SQLSTATE[HY000] [2002] No such file or directory and is not able to make changes to the database.
- Why are there messages about git files in my logs? (east.grand. .git/HEAD): failed to open stream: No such file or directory)
Full general questions
Which browsers are supported?
Lychee should work with any modern, standards-compliant web browser (note that having JavaScript enabled is a difficult dependency). Lychee does accept advantage of several HTML5 features, such equally the <video>
tag, responsive image sizing using srcset
, or link data prefetching. In detail, Lychee supports the latest versions of Google Chrome, Apple's Safari, Mozilla Firefox, Opera, and Microsoft Internet Explorer.
If you experience any bug with Lychee and wish to report information technology, make sure to specify the browser you lot're using and the version of it.
Which file formats are supported?
Lychee supports major image formats, and since version 3.2.1 some video formats every bit well. Specifically, *.jpg
, *.jpeg
, *.png
, *.gif
, *.webp
, *.ogv
, *.mp4
, *.mpg
, *.webm
, *.mov
, *.m4v
, *.avi
and *.wmv
are accepted.
If yous're uploading video files, make certain to increase your upload limits in php.ini
. See the Installation section for more than information.
What is new?
Take a wait at the Release Notes to see what'southward new.
How tin can I hands contact the LycheeOrg arrangement?
There is a gitter associated with the project, feel costless to join us there: https://gitter.im/LycheeOrg/Vestibule
How can I set thumbnails for my albums?
Thumbnails are selected automatically from the photos within the album (and any subalbums) based on the photograph sorting society specified in the Settings. Precedence is given to starred photos. In practical terms, if only i photo inside an album is starred, that photograph is guaranteed to be the top thumbnail.
Is information technology possible to create folders inside another folder? If so, how to do that?
Either press north
(as New) or use the add together bill of fare.
What headers need to be used to authenticate with the custom api_key
in the settings?
In order to bypass the CSRF protection, you can ready the api_key
setting to a surreptitious value and send that value over in the Authorization
header.
Annotation that api_key
only disables the CSRF protection, you still need to cosign to the server.
In order to cosign, use Session::login and pass the returned lychee_session
cookie to all subsequent requests.
The related code is available hither
Can I use my existing folder structure?
Non at this time. Lychee currently uses its ain folder structure and database. Please upload or import all your photos to utilise them.
Can I upload videos?
Yes, just yous may need to modify this property to a bigger value:
upload_max_filesize = 100M
Is it possible to create multiple users?
Yes. Just become to the Users
menu.
Does Lychee use ImageMagick?
Yes. Lychee uses ImageMagick when available.
How to modify the title of the site?
Get to the advanced Settings carte du jour and change the value of site_title
.
How to reset username and password?
via ssh, use the command php artisan lychee:reset_admin
How to hibernate smart albums?
Add together the following custom CSS to your user.css
or via the settings menu:
[information-id="unsorted"] { display:none; } [data-id="public"] { display:none; } [data-id="starred"] { display:none; } [data-id="recent"] { display:none; } div.content > div.divider:offset-child { display:none; } div.content > div.divider:nth-child(6) { margin-top: 10px; border-pinnacle: 0; box-shadow: none; }
How to disable the 'zoom' animation while browsing pictures?
Add the following custom CSS to your user.css
or via the settings carte:
#imageview #paradigm { transition: none !of import; animation-proper noun: none !of import; blitheness-duration: 0 !important; }
How is the upload folder protected?
From #304
Short version: It'south not protected
Long reply: #295 added some protection through symlinking, then that the URLs used are temporary.
Right now, the protection is basically through the use of difficult to guess names (it'due south an MD5 checksum of the organization fourth dimension at the time of upload). #295 non but made those names temporary (this needs to be enabled in the Settings, BTW) simply it also provided optional back up for hiding the full-size version (this is but constructive with symlinking every bit without it the URL can exist derived from that of intermediate-size images).
@ildyria recenlty posted the post-obit link on how a more effective protection could be implemented: https://bedigit.com/weblog/laravel-5-how-to-admission-prototype-uploaded-in-storage-within-view/. He didn't become downwards that road himself due to operation concerns but I agree that if somebody contributed a clean implementation as an choice, we'd probably accept information technology.
My login is timing out afterward 2 hours, how tin this be changed?
Y'all can edit your .env
and modify the SESSION_LIFETIME=120
part (in minutes).
How can I articulate the Logs?
To remove the Detect
and Warnings
, simply click on the button at the height of the Log page. Notwithstanding if the page is too heavy to load, you tin either manually empty the Logs
table or use artisan:
cd Lychee php artisan lychee:logs clean
How tin can I run across the right customer IP address when running Lychee behind Cloudflare?]
Delight see https://github.com/monicahq/laravel-cloudflare. The Lychee file that needs changing can exist found here.
Tin I set up up Lychee to lookout man a binder for new images and automatically add together them to albums?
Lychee can import photos from the command line using php artisan lychee:sync /path/to/import
. Folders in this path volition exist converted to albums, and subfolders as subalbums using php artisan lychee:sync /path/to/import --album_id="anthology ID"
.
This control can be scheduled using cron
or a systemd timer.
man crontab homo systemd.timer
Special right-click carte du jour doesn't appear for new users?
For example:
No this is normal. This user does not have the ownership of that Album, so the right click is non available. You can see sharing equally a read permission.
Also, the divider h1 shows the text "Admin" when logged in with an ordinary user. I estimate this should be "Albums"?
Actually no, this is because the user does non take any albums (yet). The h1
divider is to evidence who is the owner of those albums. Meet bellow. And yes the correct-click menu is available on the PhD Defenses part just not in the Admin parts. Also considering this user has upload correct, he tin can run across the Unsorted, Public, Starred, Recent smart albums.
Installation, migration, upgrade, update
How tin can I install Lychee without SSH access?
- 1 — Download the latest release.
- 2 — Extract and upload the folder via ftp.
- 3 — access the website. If you are at the wrong address you will be told to go to the
public
folder. Once open, you will be redirected to the install procedure. Completed you lot will be able to create an admin account and enjoy Lychee.
How do I upgrade from Lychee v3 to Lychee v4?
The process is described here.
How tin I back up my installation?
To back up your Lychee installation y'all need to perform the following steps:
- one — Create a copy of at least the following parts of the Lychee directory tree (east.g.,
/var/www/html/Lychee
):
.env public/dist/user.css public/uploads/
- two — Dump the Lychee database to a file. E.thousand., if yous are using MySQL, run:
mysqldump -u user -ppassword --databases lychee_database > lychee_backup.sql
Supplant user
, password
, and lychee_database
by the values of DB_USERNAME
, DB_PASSWORD
, and DB_DATABASE
from the .env
file in the Lychee binder.
How tin can I migrate my installation to a new host?
Back up your installation as draw in a higher place:
- iii — Download the latest release of Lychee.
- 4 — Overwrite the files with your back upward
- 5 — Restore the database on the new host, e.one thousand., for MySQL:
mysql -u user -ppassword < lychee_backup.sql
Can I host Lychee with a subpath with Nginx? Like https://case.dev/lychee/
Aye, here is a configuration to help you:
location ^~ /lychee { allonym /var/www/lychee/public; alphabetize index.php; try_files $uri $uri/ @lychee; location ~ \.php$ { if (!-e $request_filename) { rewrite ^/lychee/?(.*)$ /lychee/index.php?/$1 terminal; break; } fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; } } location @lychee { rewrite /lychee/(.*)$ /lychee/index.php?/$1 final; }
Can I host Lychee with a subpath with Apache? Similar https://example.dev/lychee/
Aye, just create a Symbolic Link and permit your apache configuration to follow them. At website.com root ln -s Lychee/public pics
and y'all volition get exactly what you want: website.com/pics
Do nosotros really need writable app/
?
From #311
Short respond: Lychee will piece of work without a writable app/
folder.
Withal, if you want to be able to update your Lychee installation with a click of a push button in the web browser (though it's disabled by default), your whole Lychee installation tree (and not merely app/
) must be http-writable.
As far as I know, the minimum set of directories that need to be http-writable is as follows:
storage/ storage/ storage/ public/uploads/small public/uploads/large public/uploads/thumb public/uploads/medium public/uploads/import public/dist
Is it possible to practice the update straight from the GUI? How?
You lot go to Diagnostics
-> Cheque for Updates
One time done y'all need to update the Diagnostic
page (click on it again in the left carte) You volition come across a Use Update
push button on the pinnacle. Click on it and done. If information technology breaks (error 500) you tin still go back to command line and practise your git pull
, drift etc...
There are some securities that y'all need to disable via the avant-garde settings menu:
- you need to allow update if your
.env
specifyproduct
:
force_migration_in_production
=i
- you lot need to allow composer :
apply_composer_update
=one
(optional)
The 2d one is really optional if updates don't demand the composer (like 90% of the time) and then it can simply stay at 0
.
Can I drift from a 64-flake organisation to a 32-chip system?
Yep, but information technology'due south not niggling or recommended. Afterward copying the database: * 1 — Download this file to your database/migrations/
binder. * 2 — Run the SQL command delete from migrations where migration='2019_04_07_193345_fix_32bit';
to make certain information technology will run. * 3 — Run php artisan drift
. This should run a one-off migration that was originally added to allow 32-bit systems to migrate from Lychee v3.
This will just piece of work on top-level albums. Subalbums will crave transmission intervention.
Why can't I see the check for update push in the GUI?
- Make certain y'all are using a
git
installation and not a downloaded release - Make sure you are on the
chief
branch - Make sure your web user has read and write access to
.git
- Check that
exec
is available. - Cheque that
allow_online_git_pull
setting is set to1
How can I stop artisan migrate
and composer
from running afterward every git pull
?
We've fix composer to install git pre-commit
and post-merge
hooks by default. - The pre-commit is to help developers by checking and fixing and code style problems before they hit our testing. If you aren't committing and changes, this volition not be run. - The postal service-merge ensures that your dependencies and database version are kept current. This tin can be disabled by creating a file .NO_AUTO_COMPOSER_MIGRATE
in your Lychee root and deleting (if necessary) .git/hooks/post-merge
. If you disable this script, you will need to run composer
and artisan migrate
manually. Alternatively, the Update UI tin be fix to handle this if you run your updates in that location.
Problems
Lychee is not working
If Lychee is not working properly, try to open up https://lychee.instance.com/Diagnostics
. This script will display all errors information technology tin can find.
Some other fashion to run across this screen is to use the control: php artisan lychee:diagnostics
When I practice 10, I become an fault api non found, what can I practise?
Open up the dev modules of your browser (usually past pressing F12
) and open up the Network tab. Redo the action with Network tab open and await at the response of the concluding query (most probable a red line). If information technology is an mistake 404 or 500, come across below, otherwise wait at our issues (including the closed ones). If nothing helps, don't hesitate to open a new one.
I have an error 404 and I'k using Apache, what can I do?
Verify that the rewrite rules of your server are correctly applied. Encounter here.
I have an fault 404 and I'm using Nginx, what can I do?
Verify that the rewrite rules of your server are correctly practical. See here.
I take an error 404 and I'thousand using php -S, what tin I practise?
Instead of doing php -S 127.0.0.1:8888
inside Lychee/public
do php artisan serve --port=8888
within Lychee. This will ensure that the paths and routes are correctly followed.
{notation} Note that the
serve
command should only be used for testing and debuging. Information technology should not be used on a production server.
I have an error 500, what can I practise?
Edit the .env
file and ready APP_DEBUG
to true
, this will let the errors to be displayed with the trace.
I have an errror 419 in the Network tab, what is going on?
Verify that your SESSION_DRIVER
is non array
. With array
, the data is stored a not-persisting PHP array, information technology is only meant for testing ! More here.
Adopt file
or database
(but that final one require some more configuration)
{notation}
php -S
web server was designed to aid application evolution. It may as well exist useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. Information technology should non be used on a public network.
I can't upload (large) photos.
Problems may occur when trying to upload photos with large file sizes or large resolutions.
If you experience problems uploading photos with large file sizes, you lot might desire to change the PHP parameters in .htaccess
(if you are using the PHP Apache module) or in .user.ini
(if you lot are using PHP with CGI or FastCGI).
If you alter the
.user.ini
file, you lot may want to rungit update-alphabetize --assume-unchanged .user.ini
afterwards.
If possible, alter these settings directly in your php.ini
. We recommend to increment the values of the following properties:
max_execution_time = 200 post_max_size = 100M upload_max_size = 100M upload_max_filesize = 100M memory_limit = 256M
Also check the settings for your web server (e.g. client_max_body_size
in nginx) allow for large uploads.
If issues occur when uploading photos with large resolutions, the consequence may lie with ImageMagick Security Policy. Review and edit the options in /etc/ImageMagick-6/policy.xml
. Editing the width
, height
and memory
options can help with enabling upload of images with larger resolutions.
For more information, encounter hither for ImageMagick 6 and here for ImageMagick 7.
What does Upstream sent too big header error message mean?
This error may be seen from your browser's console if yous're trying to debug something with Lychee. If using nginx
, endeavor adding the following to Lychee'south config and reload nginx's service:
fastcgi_buffers 16 16k; fastcgi_buffer_size 32k;
Why don't my videos have thumbnails?
You will need ffmpeg installed on your server, and to accept installed php-ffmpeg using composer equally detailed in the Installation Guide.
In one case this is taken intendance of, bank check that the has_ffmpeg
setting is prepare to one
. Lychee can reset it to 0
if information technology can't find the binaries the offset time information technology tries. The Lychee log will contain a Failed to extract snapshot: bad config
notice if that is the example.
If that doesn't help, check if metadata is extracted correctly from the video files. While viewing a video file in Lychee, just open up the info sidebar (i) and bank check if the resolution, duration, and frame rate are reported correctly. If they are not, you may need to let the metadata extractor know the location of your ffprobe
binary. The Lychee log will contain a Given path () to the ffprobe binary is invalid
error if this is the issue.
Edit the file Lychee/vendor/lychee-org/php-exif/lib/PHPExif/Adapter/FFprobe.php
, replacing the line:
protected $toolPath;
(hither's a sample location) with:
protected $toolPath = '/usr/bin/ffprobe';
using your correct binary location. If unsure, you can try running which ffprobe
on the server.
This will likely need to exist repeated for the video frame extraction code; otherwise, y'all will see in the Lychee log an Unable to load FFProbe
error. To fix that, in Lychee versions prior to four.2.0, edit the file Lychee/app/ModelFunctions/PhotoFunctions.php
, replacing the line:
$ffmpeg = FFMpeg\FFMpeg::create();
(here's the location for version 4.1.0) with:
$ffmpeg = FFMpeg\FFMpeg::create(array( 'ffmpeg.binaries' => '/usr/bin/ffmpeg', 'ffprobe.binaries' => '/usr/bin/ffprobe', ));
once more, using your correct binary locations.
Starting with version four.2.0, the file to edit is instead Lychee/app/Deportment/Photo/Extensions/VideoEditing.php
; replace the line:
$ffmpeg = FFMpeg::create();
(hither's a sample location) with:
$ffmpeg = FFMpeg::create(array( 'ffmpeg.binaries' => '/usr/bin/ffmpeg', 'ffprobe.binaries' => '/usr/bin/ffprobe', ));
Composer tin can't create a enshroud directory
- When running Composer, you may observe the following alarm:
Cannot create enshroud directory /domicile/$USER/.composer/cache/files/, or directory is non writable. Proceeding without cache
- Y'all tin specify Composer'due south cache directory with the environment variable
COMPOSER_CACHE_DIR=
. For Lychee, the cache is non necessary, and you lot can both disable it and hide the alert by specifying the location of the cache as/dev/zip
(information):
COMPOSER_CACHE_DIR='/dev/null' composer update --working-dir='/var/world wide web/Lychee'
I tin't admission the users nether settings server error or api not found on Lightspeed
If y'all receive a server mistake or "api not establish" mistake under lightspeed web server try going to cPanel
> Modern Security
and turning the characteristic off.
I know my file permissions for storage
, bootstrap/cache
, public/uploads
, and public/dist
are correct and attainable by my spider web server user, but I'm still getting a PHP error when writing to whatever of these directories.
- Make sure your PHP user and grouping is the same user and grouping every bit your web server by editing PHP'southward
www.conf
. For example, on a Fedora 32 Server system, the default user/group for php from Fedora'south standard repo defaults toapache
, even if you practice not have Apache installed. - On some operating systems with more restrictive SELinux rules (like Fedora 32 Server at the time of writing), y'all need to ready the SELinux security context of these directories for them to exist accessible by your web server user:
chcon -R -t httpd_sys_rw_content_t storage chcon -R -t httpd_sys_rw_content_t bootstrap/enshroud chcon -R -t httpd_sys_rw_content_t public/uploads chcon -R -t httpd_sys_rw_content_t public/dist
I know port eighty/443 are open up on my car, only Lychee/my server is all the same refusing all connections.
On some operating systems with more restrictive SELinux rules (similar Fedora 32 Server at the fourth dimension of writing), you need to allow your spider web server user to connect over the network with setsebool -P httpd_can_network_connect on
. Y'all can view the status of your SELinux booleans with getsebool -a
.
I know my SQL database is setup correctly, but Lychee is showing SQLSTATE[HY000] [2002] No such file or directory
and is not able to make changes to the database.
In /var/www/html/Lychee/.env
, alter DB_HOST=localhost
to DB_HOST=127.0.0.i
. Additionally, if DB_PORT=
is not gear up, it should be set to DB_PORT=3306
for mysql/MariaDB'south default port, or whatever custom port you selected when configuring your SQL server software subsequently installation.
Why are at that place letters about git files in my logs? (east.grand. .git/Caput): failed to open stream: No such file or directory
)
Lychee checks for the presence of certain files to detect whether Lychee was installed every bit a git repository or from a release archive (.zip). It as well uses them to determine which git commit is in use where applicable. This is included in the Diagnostics page to assist us in diagnosing issues.
These messages tin can be safely ignored.
{tip} Caught a error or want to contribute to the documentation? Edit this page on Github!
Source: https://lycheeorg.github.io/docs/faq.html
Post a Comment for "Websites on Nginx Server Cannot Upload Images"