How to install PHP Ncurses on Debian

Short note on how to install PHP Ncurses on Debian. This post assumes root level access.

Install pear and the and ncurses development packages:

apt-get update
apt-get install -y php-pear
apt-get install -y php5-dev
apt-get install -y ncurses-dev
apt-get install -y libncursesw5-dev

Install PHP ncurses (hit return on any prompts):

sudo pecl install ncurses

Edit /etc/php5/cli/php.ini and register the new extension by adding the following in the “; Dynamic Extensions ;” part:

extension=ncurses.so

To verify your install issue:

php -i | grep -i ncurses

Should output something similar to:

ncurses
ncurses support => enabled
ncurses library version => x.x

Leave a Reply

Your email address will not be published. Required fields are marked *