0

我刚刚开始将 VVV 与 virtualbox 一起使用。我正在尝试在 woocoomerce 开发插件上运行 npm build 但它失败了Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes)

正如他们的 github 页面上提到的那样,这是预期的,解决方案是增加,memory_limit但我在尝试找到正确的文件时遇到了很多麻烦。

因此,如果我查看 phpinfo,它会告诉我加载的配置文件是/etc/php/7.2/fpm/php.ini但该文件不存在。我的 /etc 文件夹中不存在 php 目录。

我错过了什么吗?似乎无法解决这个问题,我编辑了一些其他文件并重新加载了 vagrant,但没有运气。对此有任何帮助将不胜感激。谢谢。

4

2 回答 2

0

In case any other Vagrant newbs find themselves in a this situation. The memory limit obviously needs to be changed on the vagrant container. Here is the information from the Vagrant documentation on how to access with SSH.

SSH You can SSH into the VM via the vagrant user with the command vagrant ssh. Running vagrant ssh-config will dump out an SSH config you can use to SSH directly into that VM without use of the vagrant command.

Otherwise it is enough to run this command:

ssh vagrant@vvv.test

host = vvv.test username = vagrant password = vagrant

Also be sure to restart the server as suggest by PatricNox, but for me it was sudo service nginx restart not apache2.

于 2020-09-25T08:19:44.133 回答
0

运行php --ini会显示配置文件的路径。

请记住,这应该在 Virtualbox 容器中运行。

cd 项目 && vagrant ssh

$ php --ini 

对我来说是

$ sudo nano /etc/php5/apache2/php.ini

然后采用您的更改并重新启动

$ sudo service apache2 restart
于 2020-09-25T06:31:27.043 回答