Error on Kafka producer when application logs transferring to Kafka consumer - php

I have configured 3 Instances for a basic start to configure Kafka as sending Application logs to another machine.
There are PHP logs are transferring.
I have installed PHP, Nginx, PHPrdKafka, kafka_2.11-1.0.1., librdkafka, libsasl2-dev, libssl-dev, zlib1g-dev, libpthread-stubs0-dev, build-essential.
1 instance is working as producer, 2nd working as a broker and the last working as a consumer. When I start to test logs were continuously going to the consumer but the load on producer was getting high and an error occurs on producer:
2018/03/23 07:07:50 [error] 9819#9819: *539 connect() to
unix:/run/php/php7.0-fpm.sock failed (11: Resource temporarily
unavailable) while connecting to upstream, client: 35.190.64.128,
server: api-useast.midarexdigital.com, request: "POST
/rtb/70b4bf164fd840f80afe320b1ad98234 HTTP/1.1", upstream:
"fastcgi://unix:/run/php/php7.0-fpm.sock:", host:
"exchange.adnexus.mobi".
help me out with this.I am not getting any Clue.

Related

I can't send user mail on WordPress

I almost give up what is wrong.
I've setup web server by using nginx.
But I can't send user mail on WordPress.
When I create user or reset password, WordPress must stop.
The environment is bellow.
Ubuntu0.16.04.1
Nginx 1.12.1
PHP 7.0.1
FPM/FastCGI
postfix 3.1.0
(I can send mail by 'mail' command.)
WordPress 4.4.2
Nginx Erro log is bellow----
PHP message: PHP Fatal error: require_once(): Failed opening required
'/var/www/html/cms/wp-includes/class-phpmailer.php'
(include_path='.:/usr/share/php') in
/var/www/html/cms/wp-includes/pluggable.php on line 275" while reading
response header from upstream, client: {global_ip}, server: {domain},
request: "POST /cms/wp-admin/user-edit.php HTTP/1.1", upstream:
"fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "{host_name}",
referrer:
"/cms/wp-admin/user-edit.php?user_id=2&wp_http_referer=%2Fcms%2Fwp-admin%2Fusers.php"
Any help or hint?
Thanks every one.It was solved.
When I install WordPress ,I've used "sudo apt get wordpress",and copy them to html root.
I don't know why ,(I might not use 'cp' command with sudo )
'class-phpmailer.php' and 'class-phpmailer.php' were not moved properly.
So that when the system use wp_mail() function , the WordPress was stop.
That's all.Thanks a lot!

Build in PHPCI takes forever

I'm setting up Continues Integration and I'm wondering if everything should take so damn long.
My build is running for over a day in the mean time and still it's not finished.
It is a normal Laravel app with around 20 controllers, so a little time is granted, but over a day?
My config is fairly simple in my opinion:
build_settings:
ignore:
- "vendor"
setup:
composer:
action: "install"
test:
php_mess_detector:
allow_failures: true
php_code_sniffer:
standard: "PSR2"
php_cpd:
allow_failures: true
php_docblock_checker:
allowed_warnings: 10
skip_classes: true
php_loc:
directory: "src"
No errors, only the (by now) pesky status "Pending"
When I check the logs I get this error:
2016/01/28 08:01:32 [error] 6702#0: *4 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class 'PHPCI\Controller' not found in /var/www/vendor/block8/b8framework/b8/Application.php on line 93" while reading response header from upstream, client: someipaddress, server: green.somedomain.com, request: "GET /assets/js/plugins/datepicker/locales/bootstrap-datepicker.en.js HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "green.somedomain.com", referrer: "http://green.somedomain.com/build/view/5"
I did composer update / install and I also added the following rule to the nginx configuration:
fastcgi_param SCRIPT_NAME index.php;
My question is, is this normal? Is my config good? Am I forgetting something?
You've not set up the build runner when you set up PHPCI. The web interface merely creates the build and displays the results, you need to run the command line tool to run the builds.
There are three ways to set this up:
(New in 1.7 beta) PHPCI Worker w/ beanstalkd.
Install beanstalkd
Use supervisord (or similar) to run /path/to/phpci/console phpci:worker
(Recommended for 1.6 and below) PHPCI Daemon: https://www.phptesting.org/wiki/Run-Builds-Using-a-Daemon
(Fallback option) Cron: https://www.phptesting.org/wiki/Run-Builds-Using-Cron

readv() failed on PROPFIND request while reading php://input (PHP 7, nginx)

After upgrading my Server to PHP 7 I get several errors while running ownCloud in its current version 8.1.1.
I tried to figure out what the problem is and I came down to Sapi.php of Sabre lib.
I wrote a very small test script to isolate the error. While running the following code using a PROPFIND request, I see errors in the log and I don't get any output out of php://input.
<?php
fopen("php://input", 'r+');
echo "Done";
?>
Request using cURL:
curl -i -X PROPFIND https://cloud.example.com/readv-demo.php -d 'Demo'
Error in nginx error log:
*285599 readv() failed (104: Connection reset by peer) while reading upstream, client: 5.35.252.37, server: cloud.example.com, request: "PROPFIND /readv-demo.php HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.0-fpm.sock:", host: "cloud.example.com"
The server worked like a charm using PHP 5.6 and I tried to run PHP 7 without modifications. Everything on server-side is fine but this error.
I also tried suggestions to get around readv() errors and modified several settings like:
max_input_time = ...
max_execution_time = ...
default_socket_timeout = ...
request_terminate_timeout = ...

No script name passed to php-fpm via nginx/FastCGI

I run a PHP 5.5/5.6 instance over php-fpm without any problems (unix sockets and nginx).
Today I compiled PHP 7 and also started it as a third PHP instance. While requests get served fine with the PHP 5.5/5.6 instances for the PHP 7 instance I get:
WARNING: pid 2582, fpm_request_check_timed_out(), line 277: [pool www0] child 2813, script '' (request: " ") execution timed out (120.018160 sec), terminating
in my php-fpm log file and
[error] 1889#0: *4 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: xxx.xxx.xxx.20, server: localhost, request: "GET /info.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php70-fpm.sock:", host: "xxx.xxx.xxx.21"
in my nginx error log file.
I use fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name which also works for the PHP 5.6 instance. Although the script filename for PHP 7 seems to be empty. I'm requesting a script /info.php.
Is there any difference between using PHP 5.x and 7.0 with php-fpm?
UPDATE
At least I'm not the only one who is facing those problems as it seems. I opened a bug report here: https://bugs.php.net/bug.php?id=69850
There is also a very similar (probably identical) bug already reported over here: https://bugs.php.net/bug.php?id=69875 (thx to #crypticツ)
UPDATE 2
Try the newest alpha2. The bug is fixed there. Unix sockets work now like a charm again.
I am not sure if this can be considered as answer, but at this moment, when I am writing this answer, the bug you have raised has been deemed confirmed by the PHP Team:
[2015-06-23 12:47 UTC] remi#php.net
I confirm
PHP 5.6.10 works
PHP 7.0.0-dev (Jun 17 2015)
- network socket: OK.
- UDS: broken
Update: I just saw that you are aware of the same too!

Nginx and Noisy PHP Error Log

Whenever a PHP error occurs or the error_log() function is used in PHP on an Nginx/PHP-FPM server, the log entry is always in the format:
<TIMESTAMP> 506#0: *66699 FastCGI sent in stderr: "PHP message: <MESSAGE FROM PHP SCRIPT>" while reading response header from upstream, client: xx.xx.xx.xx, server: <SERVER>, request: "<HTTP CALL>", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "<HOST>", referrer: "<REFERRAL>"
Is there any way to make this cleaner so that there isn't so much excessive text like the way Apache logs errors? For example:
<TIMESTAMP>, <IP> <PHP MESSAGE>, <REFERRAL>

Categories