Question: I have tried to execute simple php code in the php interpreter.
When I executed the command `php -a` I getting the message

> 
> Interactive mode enabled
> 
> 
> 

Without any place for php input.
But I can execute a php code through the command `php -r`.
for example:

`php -r "echo 'Hello stackoverflow!';"`

> 
> Hello stackoverflow!
> 
> 
>

Answer: 
type `php -m` and make sure you have the readline module. If you don't you won't be able to use it.

<http://www.php.net/manual/en/features.commandline.interactive.php>

> 
> As of PHP 5.1.0, the CLI SAPI provides an interactive shell using the
>  **-a** option if PHP is compiled with the **--with-readline** option.
> 
> 
>
Because module **readline** not installed.
<http://php.net/manual/en/features.commandline.interactive.php>

This is how I install the module by recompiling php source codes:

Find previous Configure command:

```
$ php -i | grep configure
Configure Command =>  './configure'  '--prefix=/usr/local/php7' ...

```

Then recompile:

```
./configure --prefix=/usr/local/php7 \
--with-readline \

...

$ make clean 
$ make
$ make test 
$ sudo make install

```

Check if **readline** module installed:

```
$ php m | grep readline
readline

```

Then start php Interactive shell:

```
$ php -a
Interactive shell

php >

```