Skip to content

HHVM – Solving the ini_get() ‘upload_max_filesize’ and ‘post_max_size’ problem in HHVM 3.7 +

My agency has been managing what I would describe as a ‘medium’ traffic site. It gets around 5,000 unique visits per day and handles around 15,000 page views. It also has a reasonably busy membership forum.

The site uses WordPress as the CMS and we’re using HHVM to process PHP. HHVM helps to speed up admin processes and logged-in user experiences and it does a great job.

Every now and then we run into an issue with it and here is one.

When trying to return values for ini_get(‘post_max_size’) and ini_get(‘upload_max_filesize’) HHVM will return a null value.

It was breaking a plugin we are using (WP User Avatar) since it could not determine the servers maximum file upload limit and therefore, couldn’t set an upload limit for user roles.

The following solution also solves some issues with file uploading in Magento and probably loads of other issues in other apps.

Note – I’m using the Centos7 prebuilt package (https://github.com/facebook/hhvm/wiki/Prebuilt-Packages-on-Centos-7.x)

Open up /etc/hhvm/server.ini

nano /etc/hhvm/server.ini

Add the following option

hhvm.enable_zend_ini_compat=false

Restart HHVM

service hhvm restart

With much thanks – https://github.com/facebook/hhvm/issues/4993

About 

I run a small web development agency in Salisbury, UK. We provide both front-end/back end solutions and infrastructure management. My specific role is to identify the needs of our clients and providing an online solution that is easy to administer, secure, scalable and maintainable.

 

My agency website is white-fire.co.uk. Contact us if you need a consultant.

Published inHHVMLinuxPHPWordPress

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *