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

I just installed the php5-cli package in Ubuntu 11.04. If I run:

/usr/bin/php5 -a    # The -a is for interactive mode

I get the output: Could not startup.. However, if I add the -n option, which makes it ignore the php.ini file, everything works fine. The php.ini file is basically the default one, with some minor changes (memory limit, error reporting level, etc.).

Any ideas?

share|improve this question
    
I can't post an answer to my own post Yes you can. –  giannis christofakis May 31 at 9:28
    
Now I can :) I just posted the solution as an answer. –  Vinicius Pinto Sep 26 at 6:47

2 Answers 2

It would seem fairly likely that you've made a mess of your php.ini. Comment out one change at a time until it starts working again, then leave that change commented and uncomment one chang at a time. If it stops working again, then leave that one commented and continue. Once you've got only the known troublemakers commented out, you can then work on those problematic configuration items one by one until they both work, and do what you want to do.

share|improve this answer
    
Thanks, but the changes are fine (PHP is working with Apache). I tried using a clean php.ini for CLI, but I'm still getting that cryptic error. –  Vinicius Pinto Aug 15 '11 at 0:25
up vote 0 down vote accepted

Well, turns out php-cli wasn't finding the php.ini file (and for some reason didn't told me so :). Specifying it with the -c option did the trick.

share|improve this answer

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.