在Laravel Homestead上修改php.ini [英] Modify php.ini on Laravel Homestead
问题描述
是否有必要更改Laravel宅基地上的php.ini文件?例如,我想将short_open_tags设置为On-但是我看不到一种简单的方法-除了每次进入bootstead时都要进入php.ini文件并更改? /em>我不能每次都这样做.
Is there anyway to change the php.ini file on Laravel homestead? For instance, I want to have the short_open_tags set to On - however I can't see an easy way to do this - Apart from going into the php.ini file and changing it every single time I boot homestead?? I can't be doing that each time.
必须有一种简单的方法来简单地覆盖Laravel宅基地中的某些设置.如果我要上传较大的文件,本地时间不同等等怎么办?
There has to be an easier way to simply override some settings in Laravel homestead. What if I want larger file uploading, different time local etc?
我该如何实现?我已经尝试过在PHP文件顶部使用ini_set()
命令,但这并没有任何改变.
How can I achieve this? I've tried using the ini_set()
command at the top of my php files, but that changes nothing.
推荐答案
您无需修改php.ini
即可在任何版本的PHP Homestead支持上启用<?=
.
You shouldn't need to modify php.ini
to enable <?=
on any version of PHP Homestead supports.
http://php.net/manual/en/language .basic-syntax.phptags.php
5.4.0 The tag <?= is always available regardless of the short_open_tag ini setting.
如果要做要更改ini设置,则应在after.sh
脚本中执行此操作,并通过sed
命令使用我们在定居器中使用的样式:
If you do want to change ini settings you should do that in your after.sh
script and use the style we use in settler via sed
commands: https://github.com/laravel/settler/blob/master/scripts/provision.sh#L107-L125 Just make sure you're editing the right php.ini
, there is one for each version of PHP in Homestead (5.6, 7.0, 7.1, 7.2) You'll also want to restart the FPM service after changing any values.
这篇关于在Laravel Homestead上修改php.ini的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!