Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 '14 at 9:28
Now I can :) I just posted the solution as an answer. – Vinicius Pinto Sep 26 '14 at 6:47

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


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.