Error en Drush con Ubuntu 13.10

Events happening in the community are now at Drupal community events on www.drupal.org.
alfonsojosegarcia's picture

Hola tengo este error al ejecutar drush en mi instalación de Ubuntu 13.10:

The following restricted PHP modes have non-empty values:            [error]
disable_functions. This configuration is incompatible with drush.
Please check your configuration settings in /etc/php5/cli/php.ini or
in your drush.ini file; see examples/example.drush.ini for details.
PHP Fatal error:  Call to undefined function json_encode() in /usr/share/php/drush/includes/output.inc on line 708
Drush command terminated abnormally due to an unrecoverable error.                              [error]
Error: Call to undefined function json_encode() in /usr/share/php/drush/includes/output.inc,
line 708

Alguien sabe como puedo solucionarlo?
Gracias!

Comments

He instalado php5-json

alfonsojosegarcia's picture

He instalado php5-json con:

sudo apt-get install php5-json

Y ahora funciona pero sigue saliendo al principio:

The following restricted PHP modes have non-empty values:            [error]
disable_functions. This configuration is incompatible with drush.
Please check your configuration settings in /etc/php5/cli/php.ini or
in your drush.ini file; see examples/example.drush.ini for details.
Execute a drush command. Run drush help [command] to view command-specific help.  Run drush topic to
read even more documentation.

Vamos avanzando, pero alguien sabe como eliminar ese error?
Gracias

Resuelto

alfonsojosegarcia's picture

Encontré la solución:

cp /usr/share/php/drush/examples/example.drush.ini ~/.drush
cd ~/.drush
mv example.drush.ini drush.ini
vi drush.ini

Descomentar la linea:
disable_functions =

Ahora todo funciona OK!

Funciona perfecto!!

antikapital's picture

Justo tenía el mismo problema en una nueva instalación de Ubuntu 13.10 y gracias a tu post lo resolví muy rápido!!! Gracias

Tambien tuve que hacer lo mismo en php.ini

wranvaud's picture

En php.ini comente la linea disable_functions, sin hacer eso seguia con el problema...
No se pero las consequencias en la seguridad del servidor, lo hice en mi maquina local.

;disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited, pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,  pcntl_wtermsig,pcntl_wstopsig,pcntl_signal, pcntl_signal_dispatch,pcntl_get_last_error, pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo, pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority, pcntl_setpriority,

Doble error

spideep's picture

Buena noche,
A mí me salía el error doblemente. Eliminé uno de ellos con el método del comentario anterior

El segundo lo eliminé editando:
/usr/share/php/drush/includes/output.inc

agregando la siguiente función:

function json_encode($content){
                require_once 'Services/JSON.php';
                $json = new Services_JSON;
              
        return $json->encode($content);
    }

justo antes de la definición function drush_json_encode

Basado en: Using Drush without json_decode/json_encode enabled


Alexis Rengifo

Spain

Group organizers

Group categories

Región geográfica

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: