Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How to enable coloured messages for PHP CLI on console (Mac OS X, latest PHP/Apache from MacPorts)?

export CLICOLOR=1
export LSCOLORS=gxfxcxdxbxegedabagacad

doesn't seem to be enough, all PHP CLI produced output is colourless on the console. Would be good if the result looks like on the XAMPP PHP instance. Any ideas?

share|improve this question
1  
Huh? The $CLICOLOR and $LSCOLORS environment variables are for the ls command and has nothing at all to do with PHP. –  DerfK Jul 21 '12 at 17:49
    
What leads you to believe that PHP supports color? What exactly are you expecting yo xolorize? –  Zoredache Jul 21 '12 at 18:37
    
@Zoredache I'm used to get coloured output in the Symfony development that has scaffolding support on console, also tasks and TDD. It considerably improves the readability. –  Ain Jul 21 '12 at 22:35
add comment

1 Answer 1

In order to get the colour on your console with PHP CLI, php5-posix module has to be installed. With MacPorts the following command does the job:

sudo port install php5-posix

Enabling colour on the console for the PHP output will hugely improve the readability in Symfony projects for instance.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.