Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 07-18-2016, 10:09 PM
Karabaja's Avatar
Karabaja Karabaja is offline
 
Join Date: Feb 2006
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 07-19-2016, 12:02 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you search the code you will see it simply does an ini_get('upload_max_filesize').
Reply With Quote
  #3  
Old 07-19-2016, 01:19 AM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
Благодарность от:
In Omnibus
  #4  
Old 07-19-2016, 09:34 AM
Karabaja's Avatar
Karabaja Karabaja is offline
 
Join Date: Feb 2006
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
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.
Reply With Quote
  #5  
Old 07-19-2016, 10:14 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Karabaja View Post
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.
Reply With Quote
  #6  
Old 07-19-2016, 10:45 AM
Karabaja's Avatar
Karabaja Karabaja is offline
 
Join Date: Feb 2006
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
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.
Reply With Quote
  #7  
Old 07-19-2016, 12:06 PM
RichieBoy67's Avatar
RichieBoy67 RichieBoy67 is offline
 
Join Date: Apr 2004
Location: CT - Down in a hole..
Posts: 3,057
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you check your attachment settings in Vbulletin?
Reply With Quote
  #8  
Old 07-19-2016, 12:56 PM
Karabaja's Avatar
Karabaja Karabaja is offline
 
Join Date: Feb 2006
Posts: 101
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RichieBoy67 View Post
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:39 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04174 seconds
  • Memory Usage 2,234KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (1)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete