SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-04-18 17:07:07

th3pr0ph3t
Member
Registered: 2011-03-02
Posts: 28

php --interactive does not echo

When writing php code, sometimes it is handy to have a terminal with php in interactive mode:

php -a

There, if you type:
echo 'hello world';

You expect to read 'hello worldphp> ' in the console. This is how it usually works, but in crunchbang it does not.
So, is there a way to do this?

(for the moment, a test.php file will do).

Thanks in advance.

Offline

Be excellent to each other!

#2 2013-04-18 17:21:28

lcafiero
The #! Guy
From: Felton, California, USA
Registered: 2011-07-21
Posts: 2,196
Website

Re: php --interactive does not echo


Res publica non dominetur | Larry the CrunchBang Guy speaks of the pompetous of CrunchBang

CrunchBang Forum moderator

Offline

#3 2013-04-18 17:25:26

th3pr0ph3t
Member
Registered: 2011-03-02
Posts: 28

Re: php --interactive does not echo

lcafiero wrote:

not really... but thanks.

Offline

#4 2013-04-18 20:54:30

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,162

Re: php --interactive does not echo

seems to be debian related/licensing problem, how about phpsh?
https://github.com/facebook/phpsh

quick test:

phpsh
Starting php
type 'h' or 'help' to see instructions & features
php> 4+3

php> echo 3+2
5
php> $var=2

php> echo $var
2
php> 
php> quit
PHP Notice:  Use of undefined constant quit - assumed 'quit' in /usr/local/lib/python2.7/dist-packages/phpsh/phpsh.php(578) : eval()'d code on line 1

php> exit

Offline

#5 2013-04-19 15:24:42

th3pr0ph3t
Member
Registered: 2011-03-02
Posts: 28

Re: php --interactive does not echo

brontosaurusrex wrote:

seems to be debian related/licensing problem, how about phpsh?
[...]

Yes! phpsh is even better than the php command line interpreter: It has colors and allows me to edit the lines of code more properly.
I am going to use it from now on.

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo