Giter Club home page Giter Club logo

Comments (28)

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

I searched for the issue and most says this is about php.ini file or Apache server config but running php -ini | grep upload_max indicates that max allowed size is 800MB

from koel.

phanan avatar phanan commented on July 21, 2024

This is 99.99% somehing your config, which I can't help you debug, unfortunately. With PHP it's both upload_max_filesize and post_max_size, for example. Or you might be using a different config.

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

Thank you for your response.

I am running koel using docker-compose, can you please point to the config file I should change ? I am not familiar with PHP, however I tried changing php.ini, php.ini-development and php.ini-production inside docker container and restarted with docker-compose restart however it is not working.

Edit: running php --ini in container gives below output...

Loaded Configuration File:         /usr/local/etc/php/php.ini
Scan for additional .ini files in: /usr/local/etc/php/conf.d
Additional .ini files parsed:      /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini,
/usr/local/etc/php/conf.d/docker-php-ext-exif.ini,
/usr/local/etc/php/conf.d/docker-php-ext-gd.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pdo_pgsql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-pgsql.ini,
/usr/local/etc/php/conf.d/docker-php-ext-sodium.ini,
/usr/local/etc/php/conf.d/docker-php-ext-zip.ini

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

I did and it shows below...
image
image

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

So, it appears that .htaccess was overriding these properties hence Local Value is 50M.

Currently I solved it by changing value in .htaccess file and restarted using docker-compose restart. Which means once container is destroyed, those changes will be gone.

Do we have any better way for this ? Can we handle it using an environment variable ?

I will be glad to work on it and raise PR once approach is decided.

Thanks.

from koel.

phanan avatar phanan commented on July 21, 2024

Good catch! Yeah, I think making it configurable with a sensible default would be the best solution. Something like:

// .env.example

MAX_UPLOAD_SIZE =  # Max upload size, for example '50M'
// config/koel.php
[
    ...
    'max_upload_size' => env('MAX_UPLOAD_SIZE', '50M'),
    ...
],


// AppServiceProvider.php::boot()

init_set('upload_max_filesize', config('koel.max_upload_size'));
init_set('post_max_size', config('koel.max_upload_size'));

Would love to receive a PR, of course!

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

Thank you for the code snippets, I just tried to clone the master branch and run the server but unable to get it running.

I have looked through the Developer Documentation, but it just says to run npm run dev. Can you please give me list of the things I will need to install ? Here is what I have done up-to now...

  1. Installed PHP
  2. Installed Composer
  3. Run php composer.phar install
  4. Run npm run dev (it gave error about some missing extension which I installed with apt)
  5. Got server running but when accessing http://localhost:8000/api/ping it gives below error
SQLSTATE[HY000] [2002] Connection refused (SQL: select * from `personal_access_tokens` where `token` = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 limit 1)

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

I have never worked with PHP and have familiarity with JavaScript, hence I have not idea how things work here. I will try to get server running.

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

If I use DB_CONNECTION=sqlite then it gives below error,

SQLSTATE[HY000]: General error: 1 no such table: personal_access_tokens (SQL: select * from "personal_access_tokens" where "token" = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 limit 1)

Edit: I have also not worked with SQL much.

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

Finally got server running after using sqlite-persistant as a db and running php artisan migrate. However what will be the initial user to login ?

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

I tried to do ini_set but the changes were not shown in phpinfo() I think it can not be setup from php code as per this answer.

If that's true, can we do it in .htaccess somehow by retrieving the environment variable and set value ?

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

I am not sure how it's done or to say where it's configured to use .env.example file during build/installation. Here is what I have understood...

  1. Create .htaccess.example file and write upload_max_size and post_size_max rules having value of {ENV:MAX_UPLOAD_SIZE}
  2. Add it to git.
  3. Replace it during installation (don't know how)

One thought I am having is that if people write invalid rules in .htaccess.example then will it show error in the same terminal ? Because without familiarity with PHP or apache, it will be little difficult to find what's wrong in the config. In summary I think people can easily shoot their foot in this approach (please correct me if I have misunderstood).

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

Makes sense,

So How to implement it ? as I said above ?

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

I have

  • added .htaccess.example besides .env.example and put
  • "@php -r \"copy('.htaccess.example', './public/.htaccess');\"" command in composer.json

Anything else todo ?

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

No I have not raised PR because I have not tested it locally. What I am wondering is, will this approach work for docker deployment ?

from koel.

phanan avatar phanan commented on July 21, 2024

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

Yes, I have tested and it updates file.

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

Hi @phanan I have raised PR, please have a look.

from koel.

ChaitanyaPTank avatar ChaitanyaPTank commented on July 21, 2024

Solved by #1762

from koel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.