gpt4 book ai didi

php - 如何在 vagrant 中更改 php.ini?

转载 作者:可可西里 更新时间:2023-11-01 13:27:22 26 4
gpt4 key购买 nike

我想为 Vagrant 上的每台机器进行更改(sudo nano/etc/php/7.2/cli/php.ini 为当前机器更改)

upload_max_filesize
post_max_size
max_execution_time

请帮帮我。附言我试过了

sudo bash -c \'echo export "max_execution_time = 60" >> /etc/php/7.2/cli/php.ini\'
sudo bash -c \'echo export "post_max_size = 80M" >> /etc/php/7.2/cli/php.ini\'
sudo bash -c \'echo export "upload_max_filesize = 80M" >> /etc/php/7.2/cli/php.ini\'

  sed -i.bak s/max_execution_time = 30/max_execution_time = 60/g 
/etc/php/7.2/cli/php.ini

sed -i.bak s/post_max_size = 8M/post_max_size = 80M/g
/etc/php/7.2/cli/php.ini

sed -i.bak s/upload_max_filesize = 2M/upload_max_filesize = 80M/g
/etc/php/7.2/cli/php.ini

但它不起作用。谢谢,任何帮助

附言答案(在 Vagrantfile 中):

 config.vm.provision "shell", inline: <<-SHELL
sed -i.bak s/max_execution_time = 30/max_execution_time = 60/g /etc/php/7.2/cli/php.ini
systemctl restart php7.2-fpm.service
SHELL

最佳答案

你有没有运行systemctl restart php7.2-fpm.service

关于php - 如何在 vagrant 中更改 php.ini?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49996431/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com