Set upload_max_filesize for the OpsWorks php application server stack

I am running a fairly standard, non-EBS-enabled PHP application server on OpsWorks. It hosts a site created using the Expression Engine, and has only one user chef recipe that sets write permissions for PHP to the directories needed to write to EE.

I use reverse image processing anyway, so I would like the client to be able to download JPG directly from the camera, as well as short video files. This is the default limitation of php.ini upload_max_filesize and post_max_size 2 MB.

I redefined them in .htaccess, but I get the impression that this is not a first class solution. I would prefer to specify them in a custom JSON chef or, if necessary, in a chef's recipe.

Is it possible?

+4
source share
2 answers

OpsWorks by default does not overwrite anything from your php.ini. There is no template or attribute that you could overwrite.

But, as you said with the help of a special cookbook, this is possible. Just put this in the installation lifecycle event event and let it write php.ini from the template or replace it with default scripts like sedpost_max_size.

+1
source

I just thought to drop it here, since today I ran into a similar problem.

You can set php.ini values ​​in .htaccess file

The following is a snippet of code that sets the upload_max_filesize and post_max_size parameters.

php_value upload_max_filesize 500M
php_value post_max_size 510M
0
source

Source: https://habr.com/ru/post/1539651/


All Articles