When useing PHP CLI - APC crashes apache - apc_fcntl_lock failed errno:6

梦想的初衷 提交于 2019-12-13 03:18:37

问题


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.


回答1:


The solution:

My symfony2 application is run by easyPHP which loads C:\easyPHP\conf_files\php.ini (this is my php.ini for easyPHP apache server) and there I left php_apc enabled.

For me, the solution was to disable php_apc in C:\Windows\php.ini (this is my php.ini for PHP CLI [command line interface]).

This way - symfony2 can use APC to run faster, and I can use the command line to generate code without having to restart Apache every time.



来源:https://stackoverflow.com/questions/8358341/when-useing-php-cli-apc-crashes-apache-apc-fcntl-lock-failed-errno6

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!