prooph/docker-files

using Curl http://example.com/ on php-cli-7.0-blackfire

apilkarki opened this issue · 7 comments

@prolic @sandrokeil @codeliner

  1. When i try to profile a page using Curl i always find this error.
    First it starts profiling and shows Profiling: [####------------------------------------] 1/10 and then
    Are you authorized to profile this page? No probe response, missing PHP extension or invalid signature for relaying agent.

2.How we are suppose to do run php [your php script] as you have suggested.Please provide few details so new-bies can do it.

Have you tried to analyze a PHP CLI script? Does this work? Do you use also the prooph/php:7.0-fpm-blackfire Docker image for the host which serves http://example.com/.

Analyze a PHP CLI script with

$ docker run --rm -it -e BLACKFIRE_SERVER_ID=[YOUR ID] -e BLACKFIRE_SERVER_TOKEN=[YOUR TOKEN] -e BLACKFIRE_CLIENT_ID=[YOUR ID] -e BLACKFIRE_CLIENT_TOKEN=[YOUR TOKEN] --volume $(pwd):/app prooph/php:7.1-cli-blackfire run php [your PHP script]

@sandrokeil yes now that i tried 7.1-fpm-blackfire . Had the blackfire-agent running up and created a network as said in official document & tried again as :
docker run -it --rm -e BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN blackfire/blackfire blackfire curl http://example.com/ but still Profiling: [####------------------------------------] 1/10 and then
Are you authorized to profile this page? No probe response, missing PHP extension or invalid signature for relaying agent.
Do i need to do or setup something on my host/page http://example.com. I have done is nothing on the host/page but using directly a docker image of blackfire.io to profile the page.

@sandrokeil
Have you tried to analyze a PHP CLI script? Does this work?
Yes i tried even that and got the response as :
Could not open input file: User.php
Error while running command: exit status 1

@apilkarki2 Please create a new empty directory blackfire-test and change into it.

Now create a test file test.php with this content:

<?php

echo "Hello World";

Now execute the Docker run command with your credentials (replace the brackets with the corresponding value) and you should see this:

docker run --rm -it -e BLACKFIRE_SERVER_ID=[YOUR ID] -e BLACKFIRE_SERVER_TOKEN=[YOUR TOKEN] -e BLACKFIRE_CLIENT_ID=[YOUR ID] -e BLACKFIRE_CLIENT_TOKEN=[YOUR TOKEN] --volume $(pwd):/app prooph/php:7.1-cli-blackfire run php test.php

@sandrokeil
@prolic
@codeliner
Ok thanx for the tip & help !! I will get it done.
AND WHAT ABOUT THIS
""...yes now that i tried 7.1-fpm-blackfire . Had the blackfire-agent running up and created a network as said in official document & tried again as :
docker run -it --rm -e BLACKFIRE_CLIENT_ID -e BLACKFIRE_CLIENT_TOKEN blackfire/blackfire blackfire curl http://example.com/ but still Profiling: [####------------------------------------] 1/10 and then
Are you authorized to profile this page? No probe response, missing PHP extension or invalid signature for relaying agent.
Do i need to do or setup something on my host/page http://example.com. I have done is nothing on the host/page but using directly a docker image of blackfire.io to profile the page.""

Can this be closed?

If not, it can be reopened.