Giter Club home page Giter Club logo

Comments (4)

matzeeable avatar matzeeable commented on July 28, 2024 13

I just stumbled over this thread and solved it in that way:

$ php -n -dextension=phar.so -dextension=json.so -dextension=mbstring.so $(which wp) i18n make-pot [...]

I use php bin to execute wp bin so I can pass additional parameters like -n which disables all extension (see this). With dextension I can enable all extensions needed for i18n make-pot.

This also brings a huge performance improvement, here a benchmark of my WSL Ubuntu machine:

With the previous mentioned solution of @schlessera and @brenoalvs it takes about 41.42s:

$ php -d xdebug.max_nesting_level=512 $(which wp) i18n make-pot [...]
Success: POT file successfully generated!
Done in 41.42s.

And with all extensions disabled expect required ones it takes 4.42s!!

$ php -n -dextension=phar.so -dextension=json.so -dextension=mbstring.so $(which wp) i18n make-pot [...]
Success: POT file successfully generated!
Done in 4.42s.

from i18n-command.

schlessera avatar schlessera commented on July 28, 2024 1

@westonruter This is a limitation to recursion that xdebug sets into place, regular PHP without an extension doesn't have such a limit.

This limit is normally set to 256. In your case it is 100, because you are using an older version of xdebug as well (< 2.3).

You can set this limit manually using the xdebug.max_nesting_level setting.

I don't see how we could get around this from within WP-CLI, but we might want to add this to our list of common issues.

from i18n-command.

brenoalvs avatar brenoalvs commented on July 28, 2024 1

@westonruter @schlessera I was working with Docker locally so I had to change two settings to be able to run the command within my container. But the command works fine if I run it directly from my machine.

memory_limit = 512M
xdebug.max_nesting_level = 512

The settings values may be a little exorbitant, but I think they're safe for development environments.
I hope it helps someone.

from i18n-command.

EvanHerman avatar EvanHerman commented on July 28, 2024

Running this on CircleCI also throws the Maximum function nesting level error.

The following will disable xdebug in a CircleCI job:

- run:
    name: Disable xdebug PHP extension
    command: sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

from i18n-command.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.