Mamsaac

Registered
Oct 16, 2010
2
0
51
We have PHP 5.3.3 installed using cPanel WHM on our hosting, but the cli is not working properly.

When executing the command: "php -a", all output I get is "Interactive mode enabled", but no prompt appears.

I solved this issue in the past in a RedHat machine (this server is running under CentOS) by compiling PHP but adding the option "--with-readline".

The phpinfo generated with the compiled PHP doesn't show such option and I couldn't find it in the wizard for recompiling PHP.

Any ideas? Thanks in advance for the help and for taking your time =)
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
In the following folder:

Code:
/var/cpanel/easy/apache/rawopts
Create a file called all_php5 there and put this into that file:

Code:
--with-readline
Then run /scripts/easyapache --force to recompile Apache. I tested this on my machine and I get the following when entering php -a in root SSH now:

Code:
# php -a
Interactive shell

php >
Prior to adding that line and recompiling Apache, php -a was not returning a prompt for php >
 

Mamsaac

Registered
Oct 16, 2010
2
0
51
Thanks a bunch =) Haven't tried it, but this should be really useful.

I do think this should be the default on the PHP configuration... after all, who wants the cli if there's no interpreter working?

Again, thanks.