I hope that I'm posting in the right StackExchange.
I am facing a very strange problem with PHP CLI.
I'm using Symfony Framework and I can't use Symfony's commands properly when I add extensions in /etc/php5/cli/php.ini.
Better than a long speech, watch this:
1/ Normal output, no extensions
app/console doctrine:schema:update
Nothing to update - your database is already in sync with the current entity metadata.
→ Ok Note: app/console is a PHP script with a shellbang
app/console doctrine:schema:update --force
Nothing to update - your database is already in sync with the current entity metadata.
→ Ok (--force is a Symfony option, it is passed to the script by PHP)
2/ Adding two extensions to PHP
I edit php.ini, sudo vim /etc/php5/cli/php.ini.
I add two lines:
extension=cairo.so
extension=php_gtk2.so
These extensions are working perfectly. No warnings, no errors.
3/ PHP "crash", just added two unrelated extensions
app/console doctrine:schema:update
Nothing to update - your database is already in sync with the current entity metadata.
→ Ok... But:
app/console doctrine:schema:update --force
PHP Fatal error: Option inconnue --force in Unknown on line 0
Could not startup.
→ What? Not a bug from Symfony...
Note : Option inconnue just means a thing like Unknown option in french.
Same effect on other commands, Symfony commands, or standalone PHP scripts.
Conclusion: PHP has now a strange way to pass options to the called PHP script.
I also put php in front of app/console but it does not change anything.
If I comment or remove the extensions in php.ini, everything works. Just these two lines are involved.
Edit : just upgraded PHP from 5.5.12 to 5.6.3, same problem.