Blackjack
Blackjack

Reputation: 1065

Yii2: Where is the right place I can add ini_set in my Yii2-advanced-app?

I've an application in my Apache local Server and using Yii2-advanced-app. I need to edit my php.ini to support my project, I need to change precision=14 become precision=20. I'm affraid that change will affect all application in my local server. I've read some issue, and they said I can add ini_set('precision', '20'); in my current application, so that change will only affect the current application.

In some issue they said in Yii2-basic-app you can add that in web.php, under use statement. I think that file in Yii2-advanced-app equal to /config/main.php. I didn't found any use statement there, and I also have add the ini_set in there and I got nothing.

Where is the right place I can add this ini_set code in my current application?

Upvotes: 1

Views: 2393

Answers (1)

Valery Viktorovsky
Valery Viktorovsky

Reputation: 6726

The easiest way is to use '.user.ini' in your public directory.

Example of .user.ini:

precision = 20
memory_limit = 768M
post_max_size = 68M

Upvotes: 2

Related Questions