Title: How to get WP-CLI to work with bash scripts?
Last modified: June 25, 2018

---

# How to get WP-CLI to work with bash scripts?

 *  [easy_c0mpany80](https://wordpress.org/support/users/easy_c0mpany80/)
 * (@easy_c0mpany80)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/how-to-get-wp-cli-to-work-with-bash-scripts/)
 * I have wp-cli installed on a WHM/cpanel server running multi-php versions with
   EasyApache4. I am able to use wp-cli when Im either in the directory where wp-
   config resides or I use the –path command but Im now trying to use a bash script
   that will go through all the websites on the server and run wp-cli commands and
   each time it returns the html output which you should only get when phar is disabled:
 *  content-type: text/html; charset=UTF-8
 * I have followed the docs regarding enabling phar and added the following to the
   php.ini files for all versions of php on the server (5.5, 5.6 and 7)
 *  suhosin.executor.include.whitelist = phar
 * I also have the following in .bash_profile to ensure that the correct php binary
   is being used:
 *  alias wp=’/usr/local/bin/php /usr/local/cpanel/3rdparty/share/wp-cli/wp-cli.
   phar’
 * Im guessing that phar is not enabled when I use wp-cli with a script?
 * Here are some scripts Ive been trying to use
 * [https://pastebin.com/1RZyF59r](https://pastebin.com/1RZyF59r)

Viewing 1 replies (of 1 total)

 *  [wojsmol](https://wordpress.org/support/users/wojsmol/)
 * (@wojsmol)
 * [7 years, 9 months ago](https://wordpress.org/support/topic/how-to-get-wp-cli-to-work-with-bash-scripts/#post-10541386)
 * Hi [@easy_c0mpany80](https://wordpress.org/support/users/easy_c0mpany80/)
    Help
   is still needed?

Viewing 1 replies (of 1 total)

The topic ‘How to get WP-CLI to work with bash scripts?’ is closed to new replies.

## Tags

 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 1 reply
 * 2 participants
 * Last reply from: [wojsmol](https://wordpress.org/support/users/wojsmol/)
 * Last activity: [7 years, 9 months ago](https://wordpress.org/support/topic/how-to-get-wp-cli-to-work-with-bash-scripts/#post-10541386)
 * Status: not a support question

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
