I've already solved the problem, but I'll post it here for future reference and maybe it will help someone :)
The Problem:
After running PHP from command line with custom php.ini Apache crashes and throws this error apc_fcntl_lock failed errno:6
.
My configuration:
I've got easyPHP with PHP 5.3.8 and APC installed.
APC works fine for my applications run by easyPHP (Apache server).
I am useing Symfony2 framework and it comes out with nice code generators run from command line, for example: php app/console doctrine:database:create
which connects to MySQL and creates a database for me.
To run these commands I need pdo_mysql extension enabled. Since PHP CLI by default does not have pdo_mysql enabled I've copied my php.ini into C:\Windows\php.ini
(this is where PHP CLI looks for php.ini).
But I had lots of other extensions enabled (like php_intl or php_curl, php_gd2, ...) and php_apc among them.