我刚刚开始使用Resque的PHP端口(https://github.com/chrisboulton/php-resque/)
它分支PHP线程(如何,我不太确定......)但是由于这个原因,我似乎遇到了PDO连接问题。
我使用的是Illuminate \ Database,它是Laravel软件包的一部分,但我在Laravel之外使用。到目前为止,这一点很有效!
似乎我发送给Resque的每项工作都会产生这些错误:
E_WARNING Error in file 'Connection.php' at line 288: An error occurred in script '/var/www/vendor/illuminate/database/Connection.php' on line 288:
Error while sending STMT_PREPARE packet. PID=29799
E_NOTICE Error in file 'Unknown' at line 0: An error occurred in script 'Unknown' on line 0:
Unknown: send of 5 bytes failed with errno=32 Broken pipe
从我的搜索中,它说我应该尝试重新连接到数据库,所以我在作业运行之前添加到设置中。
DB::connection()->reconnect();
仍然有类似的消息:
E_NOTICE Error in file 'Connection.php' at line 826: An error occurred in script '/var/www/vendor/illuminate/database/Connection.php' on line 826:
Illuminate\Database\Connection::setPdo(): send of 5 bytes failed with errno=32 Broken pipe
E_NOTICE Error in file 'Unknown' at line 0: An error occurred in script 'Unknown' on line 0:
Unknown: send of 5 bytes failed with errno=32 Broken pipe
我不确定,我怎么能解决这个问题?还是MySQL配置问题? 我正在运行PHP 5.5.21和MySQL 14.14