This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Our next available supporter will start replying to tickets in about 8.38 hours from now. Thank you for your understanding.

This topic contains 20 replies, has 5 voices.

Last updated by George Botsev 1 month, 2 weeks ago.

Assigned support staff: George Botsev.

Author Posts
August 19, 2019 at 8:57 pm #4419179

jeffreyF-2

Hello,
I'm getting errors when running wpcli commands when I have WPML Multilingual CMS activated. steps to reproduce:

install (latest) WP today. then install (latest) Advanced Custom Fields PRO (I doubt ACF has anything to do with this but I installed it so I'm listing it here). then install (latest) wpml:

WPML Multilingual CMS
WPML String Translation
WPML Translation Management
and
Advanced Custom Fields Multilingual

I'm using the default theme (twentynineteen), and have done zero configuration.

if I cd via the command line into my site's root directory and run a wpcli command like:

wp plugin list

I'm getting this error:
PHP Fatal error: Uncaught Error: Call to undefined function WPML\Container\wpml_collect() in /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php:38
Stack trace:
#0 /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/functions.php(35): WPML\Container\Container::share(Array)
#1 /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/sitepress.php(169): WPML\Container\share(Array)
#2 /var/www/fr/wpml-test/wp-settings.php(362): include_once('/var/www/fr/wpm...')
#3 hidden link): require('/var/www/fr/wpm...')
#4 hidden link): WP_CLI\Runner->load_wordpress()
#5 hidden link): WP_CLI\Runner->start()
#6 hidden link): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\Boots in /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php on line 38
Fatal error: Uncaught Error: Call to undefined function WPML\Container\wpml_collect() in /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php:38
Stack trace:
#0 /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/functions.php(35): WPML\Container\Container::share(Array)
#1 /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/sitepress.php(169): WPML\Container\share(Array)
#2 /var/www/fr/wpml-test/wp-settings.php(362): include_once('/var/www/fr/wpm...')
#3 hidden link): require('/var/www/fr/wpm...')
#4 hidden link): WP_CLI\Runner->load_wordpress()
#5 hidden link): WP_CLI\Runner->start()
#6 hidden link): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\Boots in /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php on line 38
Error: The site is experiencing technical difficulties.

if i deactivate WPML Multilingual CMS, the error goes away. seems like all the commands are causing this error wp core update, wp theme list etc....

August 20, 2019 at 11:51 am #4423305

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hello,
Thank you for contacting WPML support.

1.- I'm truly sorry but I don't understand the issue 🙁

- If you deactivate all plugins except WPML ones, does the issue persists?

- Could you tell me how is this issue related to the functionalities of WPML?

- Have you contacted your hosting provider?

2.- Please increase the PHP Memory Limit. Minimum requirements are 128Mb: https://wpml.org/home/minimum-requirements/
You can add this to wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '128M');
define( 'WP_MAX_MEMORY_LIMIT', '128M' );

- Add it above the line /* That's all, stop editing! Happy blogging. */

Kind regards,
Carlos

August 20, 2019 at 5:32 pm #4425735

jeffreyF-2

1 - yes. the only other plugin I have is ACF, and the problem persists with that disabled. the problem is with sitepress-multilingual-cms. so deactivating that one fixes it and activating it causes the error to reappear.

- not sure what you mean here. It doesn't really do anything to WPML, the website works fine from the browser. I just can't run wp on the command line with the plugin activated https://developer.wordpress.org/cli/commands/

- no, this is a local dev environment

2 - Fixed that, thank you. I also upgraded to 7.3 since that was recommended. still having the same issue with bot of these changes.

adding var_dump( function_exists( 'wpml_collect' ) );exit; to line 37 of class-wpml-container.php I get bool(false). i then go to /sitepress-multilingual-cms/vendor/tightenco/collect/src/Illuminate/Support/helpers.php which has the function and try to echo something from that file and nothing happens so maybe it's not loading the vendor stuff properly from the command line?? not sure. but helpers.php is definitely not loading.

August 21, 2019 at 5:55 am #4428147

stianM

I'm also having the same problem. With a lot of WordPress sites for different clients, I use WP CLI a lot. It's really is a big deal when a large plugin like WPML causes WP CLI to break, and I hope to see a fix soon.

Just a tip in the meantime, jeffreyF-2: All WP CLI commands will work if you append "--skip-plugins=sitepress-multilingual-cms"

August 21, 2019 at 9:58 am #4429707

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi,

I consulted our specialists about this issue and they are already working on solving it. I have added this ticket to the one escalated too.

I will get back to you as soon as I have an answer.

Thank you very much for your patience and understanding.
Regards,
Carlos

Note: @stianm thank you very much for providing this tip

August 22, 2019 at 3:21 am #4436065

Bruce
Supporter

Hello,

I'm a developer working on WPML and I'm trying to debug this issue.
Unfortunately it's working ok for me.

+----------------------------+----------+--------+---------+
| name | status | update | version |
+----------------------------+----------+--------+---------+
| advanced-custom-fields | active | none | 5.8.3 |
| akismet | inactive | none | 4.1.2 |
| hello | inactive | none | 1.7.2 |
| nginx-helper | active | none | 2.1.0 |
| sitepress-multilingual-cms | active | none | 4.2.7.1 |
+----------------------------+----------+--------+---------+

I don't understand how this can happen. We're running the same code in CLI so the helper.php file should be included via the autoload mechanism.

Is it possible for you to create a duplicator package just in case there's some configuration setting I'm missing? - https://wordpress.org/plugins/duplicator/

Thanks,
Bruce

August 22, 2019 at 6:09 am #4436553

stianM

Updating WP-CLI from 2.2 to 2.3 actually fixed the issue for me 🙂 Just run `wp cli update`

August 22, 2019 at 1:39 pm #4439767

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi there,

There is a new Errata page created for this issue: https://wpml.org/errata/using-older-versions-of-collect-library-may-cause-fatal-error-with-wpml-4-2-x/

Regards,
Carlos

August 23, 2019 at 6:15 pm #4449329

jeffreyF-2

@stianm sadly upgrading wpcli to 2.3 did not fix my issue. @bruce I'm not sure how to upload a duplicator package to this forum. I have the export if you can just tell me how to get it to you if it's still needed. thanks!

August 23, 2019 at 7:06 pm #4449581

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi @jeffreyf-2,

I have set your next answer private. There you will find a field to provide a download link of the copy of the site in a secure way.

Regards,
Carlos

August 26, 2019 at 1:37 am #4455361

Bruce
Supporter

Hello @jeffreyf-2,

Thank you for the duplicator package. Unfortunately it's working fine for me. I'll get someone to contact you to determine what could be causing this issue for you.

bruce@bruce-p6731a /var/www/wpcli.local/htdocs $ wp plugin list
+-----------------------------+----------+--------+----------+
| name | status | update | version |
+-----------------------------+----------+--------+----------+
| acfml | active | none | 1.4.0 |
| advanced-custom-fields-pro | active | none | 5.8.3 |
| akismet | inactive | none | 4.1.2 |
| duplicator | active | none | 1.3.18 |
| hello | inactive | none | 1.7.2 |
| sitepress-multilingual-cms | active | none | 4.2.7.1 |
| wpml-string-translation | active | none | 2.10.5.1 |
| wpml-translation-management | active | none | 2.8.6.2 |
+-----------------------------+----------+--------+----------+

August 26, 2019 at 7:03 am #4456213

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

Hello.
I am George and I was assigned to try to help you with the issue.
Please first make sure that you have updated wp-cli properly, as it was mentioned that it fixes the issue.
I am saying that because It is possible that the update did not complete for you. Like in an example if the executable is not owned by your user, so you might have to run:

sudo wp cli update

If you can also test with a fresh version of WP Cli - just try to download it in another folder (as if you do the initial wp cli testing) as noted in hidden link

August 26, 2019 at 2:18 pm #4459619

jeffreyF-2

/var/www/fr/wpml-test $ sudo wp cli update
Success: WP-CLI is at the latest version.

/var/www/fr/wpml-test $ wp --version
WP-CLI 2.3.0

/var/www/fr/wpml-test $ wp plugin list
Fatal error: Uncaught Error: Call to undefined function WPML\Container\wpml_collect() in /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php:37
Stack trace:
#0 /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/functions.php(35): WPML\Container\Container::share(Array)
#1 /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/sitepress.php(169): WPML\Container\share(Array)
#2 /var/www/fr/wpml-test/wp-settings.php(362): include_once('/var/www/fr/wpm...')
#3 hidden link): require('/var/www/fr/wpm...')
#4 hidden link): WP_CLI\Runner->load_wordpress()
#5 hidden link): WP_CLI\Runner->start()
#6 hidden link): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\Boots in /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php on line 37
Error: The site is experiencing technical difficulties.
.
.
.
.
.
/var/www/fr/wpml-test $ curl -O hidden link
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5412k 100 5412k 0 0 428k 0 0:00:12 0:00:12 --:--:-- 298k

/var/www/fr/wpml-test $ php wp-cli.phar --version
WP-CLI 2.3.0

/var/www/fr/wpml-test $ php wp-cli.phar plugin list
Fatal error: Uncaught Error: Call to undefined function WPML\Container\wpml_collect() in /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php:37
Stack trace:
#0 /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/functions.php(35): WPML\Container\Container::share(Array)
#1 /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/sitepress.php(169): WPML\Container\share(Array)
#2 /var/www/fr/wpml-test/wp-settings.php(362): include_once('/var/www/fr/wpm...')
#3 hidden link): require('/var/www/fr/wpm...')
#4 hidden link): WP_CLI\Runner->load_wordpress()
#5 hidden link): WP_CLI\Runner->start()
#6 hidden link): WP_C in /var/www/fr/wpml-test/wp-content/plugins/sitepress-multilingual-cms/classes/container/class-wpml-container.php on line 37
Error: The site is experiencing technical difficulties.

August 26, 2019 at 2:31 pm #4459777

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+03:00)

Thank you for testing.
I am sorry that the problem is still not gone.
Could you please provide us with temporary access to your machine where you have made these tests, so that we can try to debug the issue further and to try to find the cause for this?

August 28, 2019 at 2:02 pm #4474955

jeffreyF-2

I don't have this particular test site online. I do have another site online that is using wpml and it is working fine on that server (and throwing the same errors locally). this seems to an issue on my dev machine. I can run any commands you'd like to see output on though.