vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Vbulletin won't read PHP Maximum Upload Size correctly when using HHVM (https://vborg.vbsupport.ru/showthread.php?t=323054)

Karabaja 07-18-2016 10:09 PM

Vbulletin won't read PHP Maximum Upload Size correctly when using HHVM
 
My hosting suggested using hhvm as a better alternative to apache+php, or rather less prone to exploits and able to handle more load. Anyway atm we are using hhvm-fastcgi-nginx combination. Using VB 3.8.7. PHP: 5.6.99-hhvm

Even though upload_max_filesize in php.ini is set to 60M vbulletin seems to have uploads limited to 10MB.
In admin panel main page it reads:
Code:

PHP Max Post Size        N/A
PHP Maximum Upload Size        N/A

When I ran diagnostics and check file upload here is what it reads:
Code:

Pertinent PHP Settings
file_uploads: On
open_basedir: None
safe_mode: Off
upload_tmp_dir: /tmp
upload_max_filesize: 10.00 MB

I realize vbulletin has no support for HHVM but I was hoping someone at least has a clue as to where it picks up 10MB limit from and maybe I can change it somehow. I imagine if it can't read the value from php.ini it defaults to this value.

Paul M 07-19-2016 12:02 AM

If you search the code you will see it simply does an ini_get('upload_max_filesize').

RichieBoy67 07-19-2016 01:19 AM

You can try adding a php.ini file with the max upload size right in the root directory of your domain. This works in some servers. You can also try htaccess.

If you made changes to php.ini in your server and you are not seeing changes make and use a php.info file or view php info in your vbulletin cpanel to make sure you are changing the correct php.ini..

Karabaja 07-19-2016 09:34 AM

Quote:

Originally Posted by Paul M (Post 2573418)
If you search the code you will see it simply does an ini_get('upload_max_filesize').

Yes but how does it read 10MB when php.ini has that value set at 60M.
And php.info doesn't mention upload_max_filesize anywhere.
Is there anything I could change in vbulletin code that could trick it to read a different directive from php.ini for "upload_max_filesize". Like this one for example which shows up fine in php.info:
hhvm.server.upload.upload_max_file_size.
Or just have it not fetch the value from php.ini at all and set it to something to my desire. It is a dedicated server btw.
Btw running this example script in browser also doesn't read the vale:
Code:

http://php.net/manual/en/function.ini-get.php
It returns the value for "display errors" for example but it doesn't for post_max_size.


@RichieBoy67, thanks for your suggestions but I've tried similar things already. htaccess wouldn't work as it is nginx server but I've tried .user.ini file that should allow per folder override but no help. It think it just a bug with hhvm that won't allow fetching some of the ini directives properly while others read fine.

Paul M 07-19-2016 10:14 AM

Quote:

Originally Posted by Karabaja (Post 2573433)
Yes but how does it read 10MB when php.ini has that value set at 60M.

Because thats what php is returning.
It can only display the information returned to it.
Obviously there is an issue with whatever HHVM is passing incorrect information back to php.

Karabaja 07-19-2016 10:45 AM

Quote:

Originally Posted by Paul M (Post 2573434)
Because thats what php is returning.
It can only display the information returned to it.
Obviously there is an issue with whatever HHVM is passing incorrect information back to php.

Well php doesn't seem to return anything at least not for that directive. Or at least not from the browser or ssh. But when I run that example php script from ssh with hhvm -f test.php it reads post_max_size just fine.

Anyway I can't seem to find ini_get calls in vbulletin's attachment.php but I imagine it is used somewhere in the code to fetch the server's upload size limit. So any help please on telling me where and if I could change it to call hhvm.server.upload.upload_max_file_size instead of upload_max_filesize.

RichieBoy67 07-19-2016 12:06 PM

Did you check your attachment settings in Vbulletin?

Karabaja 07-19-2016 12:56 PM

Quote:

Originally Posted by RichieBoy67 (Post 2573442)
Did you check your attachment settings in Vbulletin?

Yes they are all fine. We had no issues before on the same server with apache running. It is just since the switch to hhvm+nginx that this appeared.


All times are GMT. The time now is 04:46 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01085 seconds
  • Memory Usage 1,731KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete