php -a (Interactive mode) hangs and does not run

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read this

php -a (Interactive mode) hangs and does not run

Postby pythonscript on Thu Jan 19, 2012 10:58 pm

When I run php -a, I get the message "Interactive mode enabled" in the terminal, but nothing happens. I installed php5 from the repositories, and I sincerely need this feature. I assume this has something to do with php not being compiled with the libreadline (since I've found that potential issue elsewhere) but is there a way to fix this *without* recompiling php (which is an incredibly major hassle)?
pythonscript
Level 2
Level 2
 
Posts: 53
Joined: Wed Nov 09, 2011 3:49 pm

Linux Mint is funded by ads and donations.
 

Re: php -a (Interactive mode) hangs and does not run

Postby dagon on Sun Jan 22, 2012 9:43 am

There is a package in the repos named php5-cli that should do the trick for you.
Package description:
This package provides the /usr/bin/php5 command interpreter, useful for
testing PHP scripts from a shell or performing general shell scripting tasks.
The following extensions are built in: bcmath bz2 calendar Core ctype date
dba dom ereg exif fileinfo filter ftp gettext hash iconv json libxml
mbstring mhash openssl pcntl pcre Phar posix readline Reflection session
shmop SimpleXML soap sockets SPL standard sysvmsg sysvsem sysvshm tokenizer
wddx xml xmlreader xmlwriter zip zlib.
Image
User avatar
dagon
Level 7
Level 7
 
Posts: 1509
Joined: Mon Dec 06, 2010 4:33 am
Location: Kungälv, Sweden

Re: php -a (Interactive mode) hangs and does not run

Postby pythonscript on Sun Jan 22, 2012 10:26 am

The php5-cli package is already installed. That package allows you to run php scripts from the terminal with

Code: Select all
php script.php


which is different from interactive mode.
pythonscript
Level 2
Level 2
 
Posts: 53
Joined: Wed Nov 09, 2011 3:49 pm

Re: php -a (Interactive mode) hangs and does not run

Postby dagon on Sun Jan 22, 2012 10:47 am

I'm at Mint 10
when I tried "php -a" in the terminal it prompted me to install php5-cli.
Installed it gives me a list of errors concerning symlinks ending with the message interactive shell and a prompt:php >

Here is a Debian bugreport:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=576218
Image
User avatar
dagon
Level 7
Level 7
 
Posts: 1509
Joined: Mon Dec 06, 2010 4:33 am
Location: Kungälv, Sweden

Re: php -a (Interactive mode) hangs and does not run

Postby pythonscript on Sun Jan 22, 2012 10:56 am

Ah, ok. I had already installed php5-cli on my system before trying interactive mode, so I didn't see that error. Mint 10 is Ubuntu based, correct? I don't have this problem on my Ubuntu distributions, but I'm not using Linux Mint's Ubuntu derivatives, just the Debian one. Hopefully something will come out of that bugreport that won't involve having to compile php5 from source. I've had the problem about not being linked to libreadline on hosting platforms before, but never from a package standard to a repository.
pythonscript
Level 2
Level 2
 
Posts: 53
Joined: Wed Nov 09, 2011 3:49 pm


Return to Newbie Questions

Who is online

Users browsing this forum: No registered users and 7 guests