Skip to content

global variables are null with wp-cli #4019

@wonderyann

Description

@wonderyann

Hi

Runing this command (and all others) :
$ wp plugin list --debug

Produces these errors :

Debug (bootstrap): Using default global config: /home/xxxx/.wp-cli/config.yml (0.013s)
Debug (bootstrap): No project config found (0.014s)
Debug (bootstrap): Loading packages from: /home/xxxx/.wp-cli/packages/vendor/autoload.php (0.158s)
Debug (bootstrap): ABSPATH defined: /zzzz/www/ (0.159s)
Debug (bootstrap): Set URL: http://www.yyyy.fr (0.159s)
Debug (bootstrap): Begin WordPress load (0.159s)
Debug (bootstrap): wp-config.php path: /zzzz/www/wp-config.php (0.159s)
PHP Warning:  in_array() expects parameter 2 to be array, null given in /zzzz/www/wp-includes/kses.php on line 1176
Warning: in_array() expects parameter 2 to be array, null given in /zzzz/www/wp-includes/kses.php on line 1176
PHP Notice:  A session had already been started - ignoring session_start() in /zzzz/www/wp-content/plugins/userpro/index.php on line 17
Notice: A session had already been started - ignoring session_start() in /zzzz/www/wp-content/plugins/userpro/index.php on line 17
PHP Fatal error:  Call to a member function do_uploads_dir() on a non-object in /zzzz/www/wp-content/plugins/userpro/index.php on line 21
Fatal error: Call to a member function do_uploads_dir() on a non-object in /zzzz/www/wp-content/plugins/userpro/index.php on line 21

It occurs in both cases (kses.php on line 1176 & plugins/userpro/index.php on line 21) on variables called as globals that appear to be empty with wp-cli but well working from http request.

Wordpress version is 3.9 and

$ wp --info
PHP binary:     /usr/bin/php5
PHP version:    5.5.9-1ubuntu4.20
php.ini used:   /etc/php5/cli/php.ini
WP-CLI root dir:        phar://wp-cli.phar
WP-CLI packages dir:    /home/xxxx/.wp-cli/packages/
WP-CLI global config:   /home/xxxx/.wp-cli/config.yml
WP-CLI project config:
WP-CLI version: 1.1.0
$ wp package list
+----------------+----------------+------------+--------+------------------+
| name           | authors        | version    | update | update_version   |
+----------------+----------------+------------+--------+------------------+
| wp-cli/server- | Daniel Bachhub | dev-master | none   |                  |
| command        | er             |            |        |                  |
+----------------+----------------+------------+--------+------------------+

The wp-config.php have some specific variable definitions and comments are in french (in case it could produce a parsing error somewhere)?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions