Drush PHP.ini Requirements? Which functions have to be enabled?

crimsondryad's picture

Ok, I've been looking around the web for HOURS. I have yet to find anything that says "Drush requires these functions to run." I've seen some stuff that says "system" (I knew that). We're running a pretty tight ship and even though we're using a drush-specific php.ini, I don't just want to open it completely up.

Here is our disable_functions setting in php.ini
disable_functions =passthru,proc_open,popen,curl_multi_exec,parse_ini_file,show_source

Does Drush need any of these? Please...pretty please...someone have a good answer. sigh

UPDATE: Ok, the answer was so easy I feel a bit stupid for not figuring it out before. :P I did a grep on the drush directory for each of the disabled functions to see if they were used anywhere in Drush.

Here is a list of functions you can safely disable in your Drush-specific php.ini (for Drush v3):
passthru, popen, curl_exec, curl_multi_exec, shell_exec, parse_ini_file, show_source

UPDATE 2: After testing extensively (we installed Webform version 2.1, enabled it, took out one of the functions, updated, ran drush updb, then look for failures) we finally narrowed the problem function down to proc_open. Oddly, I did a grep on the Drush folder AND the Drupal install folders...I don't see that function returned anywhere. Does anyone know where it's getting called? We know the grep worked because it returned the disabled_functions list in our drush-specific php.ini.


Re: Drush

shawn.palmer's picture

While don't have a straight Drush uses these, and with lots of reading over drush I can't be sure, but I can see drush using both curl_multi_exec, parse_ini_file

I would be almost 100% on parse_ini_file as it takes ini(or other settings files) as converts them into arrays which I would suspect is for reading the drupal info files.

as for curl_multi_exec this can be used for getting file/info from websites that require secondary requests.

I would doubt that proc_open or popen are use as one is for processes and the other for binary files like audio

passthru and show_source are a little more on the outside chance that drush could be using these

Drush also uses pcntl_exec

dennisluitwieler's picture

I had the same problem with drush, but with me a different disabled function caused the problem.
The function wasn't mentioned yet, so here it is. Perhaps it saves somebody else some valuable time.


After removing this particular function from the disabled list it worked like a charm.