no Cli for php 5.3.x on SUSE 11.2 ?!

Hi all,

I’m changed recently my OS from Ubuntu 9.10 (amd 64) to OpenSuse 11.2 (64 bit) and I have a little issue when using php command line on terminal : php-cli is a php extension that provide a pretty illustrative executed php code (it’s a way of running PHP Scripts that aren’t on a web server).

Unfortunately ,I haven’t found php-cli when using yast and also I haven’t found an rpm of this extension for php 5.3.0

In fact, I need this extension because it help me wen using command line for symfony framework.

please, can any one help me to install it on suse ?

Have you tried running

php

on the terminal? That’s what the CLI program is called in 11.1. It’s in the main php5 package, no separate php-cli package required.

Maybe something here that might help:

PHP CLI

I think the only extra I install for my own php from the command line is php-readline.

On SuSE php-cli is included with the php5 package itself and gets installed always.

No no no …
php work fine on terminal, that’s mine that i have no problem with it. I’m speaking about php-cli exentension that colorize php result on terminal to have an expressive show of executed php code on terminal.

My issue is that I cannot install correctly this extension on suse 11.2 (64bit) under php5.3.0 : that’s mine that i can run php file using terminal but there no color on executed code :frowning:

this is not a big problem for me, but I have worked for a long time on ubuntu (i have installed php-cli extension with synaptic) using terminal because I work with symfony FW and the colored executed code is very useful.

The php5-cli package in Ubuntu seems to be just a command line interpreter, nothing about colorization of the code.

http://packages.ubuntu.com/karmic/php5-cli

Are you sure colorization wasn’t done by some other extension? A search of php-cli colorize showed nothing relevant.

I’d guess that depends on how this is interpreted.

“The following extensions are built in: bcmath bz2 calendar ctype date dba dom exif filter ftp gettext hash iconv json libxml mbstring mime_magic ncurses openssl pcntl pcre posix readline Reflection session shmop SimpleXML soap sockets SPL standard sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter zip zlib.”

Perhaps ncurses is the bit he wants?

Thank you ken_yap for your replay

In fact, Ubuntu is always installed on my machine and I’ve tried to uninstall php-cli that require php-commun and after that I could not use php with command line … It seems that ubuntu need php-cli (and eventually php-commun) to enable the command line

On suse , it’s different: there are no php-cli or php-commun installed and I can use the command line php without coloring code

with the help of google I’ve found this rpm
http://download.opensuse.org/repositories/home:/xrow/RHEL_5/x86_64/php-cli-5.3.0-62.1.x86_64.rpm but when I try to install it with yast I recive this message “Could not find the rpm-Package in Pool”

any idea ?

You don’t understand - php5-cli does not exist on SuSE nor installing a Redhat package like you are trying to do above (Yes, the repository says RHEL5 which is Redhat Enterprise Linux 5) will do anything except at worst cripple your php installation by inserting incompatible modules.

What’s this coloring thing anyway? When you execute a PHP program with the CLI PHP interpreter it’s not showing you the code, it’s busy running it. Are you confusing it with the syntax coloring that’s done by vim and other text editors?

On ubuntu php command line is like :

http://www.symfony-project.org/images/jobeet/1_2/08/slugify_doc.png

and on suse (or windows) php command line is like :

http://anandshahil11.files.wordpress.com/2008/10/symfony_pic2.jpg

do you understand the difference ?

How do you know it’s not symfony that’s doing the coloring?

Chrysantine
PHP CLI is avaiable on all popular operating systems: Linux, Windows, OSX, Solaris. Popular Linux distibutions (such as Ubuntu, Debian, Fedora Core, Suse and etc.)

read this : PHP CLI

Yes, we know what php-cli is. It’s a pretty standard thing. Fact is, it’s included in the php5 package on openSUSE. What I’m questioning is why you think the coloring comes from it. I can’t think of a reason why CLI would do the coloring. It’s just an command line interpreter, duh.

Maybe all you are missing is the php5-ncurses package. Maybe symfony detects there is no ncurses and so can’t colorise the output. Have you tried installing php5-ncurses?

No way php or php-cli is doing this. It’s a console color setting, as you can see from the prompt. And indeed, such things are not possible on windu systems.
@ken-yap: if you ever tried one of "jengelh"s kernels, you would have seen things like this. Same thing if you ‘su’, the prompt turns red.

So, in short: AFAIK the colors have nothing to do with php or whatever, just terminal settings.

I think he posted the Windows screenshot to show what no color looks like. He really should have posted an openSUSE screenshot to not confuse the issue.

Let’s be clear on some things. I know what php-cli is. I know what colourisation does. I sometimes see it in ls output or vim syntax highlighting. Sometimes annoying when the color choices are poor. Anyway…

I think the OP is chasing a red herring. Firstly it’s not showing “code”, it’s showing results of a test, or maybe a backtrace. Secondly, I’m 99% sure it’s not php-cli doing the coloring, but rather the PHP script symfony and it can only do that when PHP has ncurses loaded. On Ubuntu, php-cli has the ncurses module compiled in. Hence my suggestion to install php5-ncurses on openSUSE.

Hi
Yes, I run colorized settings in my shell by adding the following to my
~/.bashrc;


RS="\\033[0m\]" # reset
HC="\\033[1m\]" # hicolor
UL="\\033[4m\]" # underline
INV="\\033[7m\]" # inverse background and foreground
FBLK="\\033[30m\]" # foreground black
FRED="\\033[31m\]" # foreground red
FGRN="\\033[32m\]" # foreground green
FYEL="\\033[33m\]" # foreground yellow
FBLE="\\033[34m\]" # foreground blue
FMAG="\\033[35m\]" # foreground magenta
FCYN="\\033[36m\]" # foreground cyan
FWHT="\\033[37m\]" # foreground white
BBLK="\\033[40m\]" # background black
BRED="\\033[41m\]" # background red
BGRN="\\033[42m\]" # background green
BYEL="\\033[43m\]" # background yellow
BBLE="\\033[44m\]" # background blue
BMAG="\\033[45m\]" # background magenta
BCYN="\\033[46m\]" # background cyan
BWHT="\\033[47m\]" # background white

PS1="$HC$FYEL$(ppwd \l)\u@\h:\w\$ $RS"
PS2="$HC$FBLE> $RS"


Cheers Malcolm °¿° (Linux Counter #276890)
SUSE Linux Enterprise Desktop 11 (x86_64) Kernel 2.6.27.39-0.3-default
up 4 days 4:28, 3 users, load average: 0.09, 0.08, 0.07
GPU GeForce 8600 GTS Silent - CUDA Driver Version: 190.18

hi,

thank you for your replay but it seems that the only person who understand me is ken_yap : My suse terminal include color ( red when root, hidden file, executable file …) and that’s not my issue, I just want to have colorized result when I execute php file on my Suse terminal.

I agree with ken_yap but I can’t find php5-ncurses …
I think that the appropriate extension in my case is php5-readline .

in yast detail I see:

#########
#php5-readline
#PHP interface to libedit, which provides editable command line #as well as PHP interactive mode (php-a)
#########

and oddly, when I install it (following the type of architecture) php return me the following message: “php segmentation fault” :cry:

perhaps it will be better if I stop finding a solution …

zypper install php5-ncurses

Where does it come from? Well, in 11.1, and I suspect also in 11.2:

$ zypper info php5-ncurses
Repository: openSUSE-11.1-Update
Name: php5-ncurses
Version: 5.2.11-0.1.1
Arch: x86_64
Vendor: openSUSE
Installed: No
Status: not installed
Installed Size: 85.0 K
Summary: PHP5 Extension Module
Description:
This module adds ncurses support (for CLI and GCI versions only).

which means it was probably in the OSS repository and got updated in the Update repository. Do you have the OSS repository and the Update repository subscribed to?

You’d get the 5.3 version though in 11.2.

PS: Hmm, you might have some valid reason to wonder why you can’t find php5-ncurses. It’s not on the list of the DVD5 contents. This needs further investigation:

http://en.opensuse.org/Package_List/11.2/DVD5-i586

PPS: Can’t find php5-ncurses for 11.2 at software.opensuse.org/search. Wonder if it’s included in php5 RPM now and needs to be enabled in cli/php5.ini. Anybody know?

Thanks for teaching me, I definitely don’t know what the php command line parser is. Why don’t you teach me how to move the mouse while you’re at it.