Keyword

Plugin conflict and recommended PHP settings for upload.

  • Goble002
  • Goble002's Avatar Topic Author
  • Away
  • Premium Member
More
1 week 6 days ago #178550 by Goble002
Hi,

was getting error below with Front-end editing whenever I edit item. So I switched to latest router as recommended here. www.joomlaworks.net/forum/k2-de/53846-fehlermeldungen-in-router-php-line-292
[b]Notice[/b]: Trying to get property 'alias' of non-object in [b]/home/.../components/com_k2/router.php[/b] on line [b]292[/b]

While uploading 5.8Mb image on Front-end I got following errors.
[b]Deprecated[/b]: Array and string offset access syntax with curly braces is deprecated in [b].../media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php[/b] on line [b]2726[/b]

[b]Notice[/b]: Trying to access array offset on value of type int in [b].
../media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php[/b] on line [b]2726[/b]

[b]Notice[/b]: Trying to access array offset on value of type int in
...[b]/media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php[/b] on line [b]2726[/b]

[b]Fatal error[/b]: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in [b].../media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php[/b] on line [b]2797[/b]

So I switch from PHP 7.4 to 7.3. Now only error :
[b]Fatal error[/b]: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in [b].../media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php[/b] on line [b]2797[/b]

The error was only with big files. No issue with a 350kb jpg. I found out that a plugin was causing the issue : "content jdownloads".

1. Any chance I can uploads working with this plugin ? Change ordering ?

2. A 5.4Mb file will typically take nearly 3 minutes to upload. It might takes longer for slow connections. That said, can you recommend PHP settiongs for my case ?

Actually it is : 
allow_url_fopen = Off
display_errors = On
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 60
max_input_vars = 1000
memory_limit = 128M
post_max_size = 7M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php74"
upload_max_filesize = 6M
zlib.output_compression = Off

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 week 6 days ago #178563 by Fotis
post_max_size should be equal to upload_max_filesize and both at least to a decent value like 64M. Both are small that's why you can't upload anything...

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Away
  • Premium Member
More
1 week 5 days ago #178574 by Goble002
Hi Fotis and thanks for your valuable input.

post_max_size should be equal to upload_max_filesize 

Actually it has been recommended by my hosting company (and it's the only advice thay gave me) to have "post_max_size" slightly more than "upload_max_filesize", In cPanel: it says : 

post_max_sizeSets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize. Generally speaking, memory_limit should be larger than post_max_size.

Referring to:

at least to a decent value like 64M.

I can't afford to have up to 64Mb files lying on the server (and I will need these files). This is where (and I guess the only way) where I can restrict the size upload limit. 6Mb would be a jpg file of 4000px, 72dpi, Image quality : 86%, and a few other tweaks to have the best quality vs size ratio. 

Refering to:

Both are small that's why you can't upload anything...

Actually it is not. I can upload files up to 6Mb if I disable the plugin. I was thinking that I could tweak my PHP settings so that I could get both the upload and plugin working.

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
1 week 5 days ago #178583 by Fotis
It's simpler to say that both should be equal. As long as the limits are generous enough, you'll never have to worry about this.

As for the limits itself, they are just that: limits. No memory or other resources is pre-allocated. So these should be generous (even 64M you mention is little for today's sites and servers).

Please try what I said and we can argue later.

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.

  • Goble002
  • Goble002's Avatar Topic Author
  • Away
  • Premium Member
More
1 week 4 days ago - 1 week 4 days ago #178596 by Goble002
Hi,

64Mb set for both: No change. Uploads of 5-6Mb file will still cause the error when "Content - jDownloads" plugin enabled. Like explained no issue with 1Mb files.

I have even tried to change the order of the plugin: First, last and middle.
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in .../media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php on line 2797


PHP settings:
allow_url_fopen = Off
display_errors = On
enable_dl = Off
file_uploads = On
max_execution_time = 30
max_input_time = 240
max_input_vars = 1000
memory_limit = 128M
post_max_size = 64M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php74"
upload_max_filesize = 64M
zlib.output_compression = Off
allow_url_include = Off
Last edit: 1 week 4 days ago by Goble002.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum