Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Apr 01 17:02
    Jonas18175 opened #552
  • Mar 16 10:45
    andig closed #549
  • Mar 16 10:45
    andig commented #549
  • Mar 16 10:44

    andig on 2.4.0

    (compare)

  • Mar 16 10:01

    andig on andig-patch-1

    (compare)

  • Mar 16 10:00

    andig on master

    Upgrade fixer (#550) (compare)

  • Mar 16 10:00
    andig closed #550
  • Mar 16 05:30
    javaDeveloperKid commented #549
  • Mar 04 16:44
    javaDeveloperKid commented #549
  • Mar 04 16:38
    andig review_requested #550
  • Mar 04 16:38

    andig on master

    Fix trim(nil) deprecated causin… (compare)

  • Mar 04 16:38
    andig closed #551
  • Mar 04 16:19
    andig labeled #549
  • Mar 04 16:09
    javaDeveloperKid opened #551
  • Mar 04 16:00
    andig commented #549
  • Mar 04 15:51
    javaDeveloperKid commented #549
  • Mar 04 15:22
    andig commented #547
  • Mar 04 15:11
    javaDeveloperKid commented #549
  • Mar 04 15:10
    javaDeveloperKid commented #549
  • Mar 04 15:09
    javaDeveloperKid commented #549
Matthieu Napoli
@mnapoli
yeah I definitely see what you mean
Marc J. Schmidt
@marcj
and thats how most memory leaks happen
Matthieu Napoli
@mnapoli

so do you think it would make sense to try to find a middleground between PHP-FPM and PHP-PM? Like this:

  • keep one process = one request (to simplify everything, avoid memory issues)
  • but keep the perf improvement by running the bootstrap before the process handles the request

?
I can see several options for how, but I want to make sure the premise is all right?

Marc J. Schmidt
@marcj
I tried hard but haven't found that golden way. the biggest improvement comes really when you work with php as you would with java where your whole apllication is in memory prepared waiting for incoming requests
Matthieu Napoli
@mnapoli
here are ideas, I have no idea if they are doable:
  1. add a new feature in PHP-FPM so that PHP scripts can be run when PHP processes are spawned, until a special instruction that signals to PHP-FPM that the process is now fully initialized and can be added to the pool of PHP processes (i.e. an inverse of fastcgi_finish_request(), maybe like fastcgi_request_ready()) -> PHP-FPM stops the process and waits for a request -> when a request comes in, PHP-FPM populates the global variables ($_GET, etc.) and resumes the execution of the PHP script right were it stopped
  2. implement a FCGI server (much like PHP-PM, that's why I'm asking you today) where the "LoadBalancer" process inits the framework, then loops for each incoming request -> on each request it forks -> the fork handles the request and then dies (1 process == 1 request), while the original process (LoadBalancer) waits for the next request
in both cases we keep one process == one request, but each process only handles 1 request so no memory issue (and we have the perf improvement because bootstrap is not part of the response time)
Matthieu Napoli
@mnapoli
I'm also wondering if there's a solution n°3 with pthreads, but I'll need to read more about that extension
Luke Rotherfield
@LRotherfield
Hi Guys, has anyone had any success running Oro Platform with php-pm?
Marc J. Schmidt
@marcj
@LRotherfield I don't think so
Luke Rotherfield
@LRotherfield
OK, fair enough, thanks for the response
kugu
@kugu

[www-data@sp-prod1 backend]$ composer.phar update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1

- php-pm/php-pm dev-master requires react/http dev-master#cd15204bd15d106d7832c680e4fb0ca0ce2f5e30 -> satisfiable by react/http[dev-master].
- php-pm/php-pm dev-master requires react/http dev-master#cd15204bd15d106d7832c680e4fb0ca0ce2f5e30 -> satisfiable by react/http[dev-master].
- Removal request for react/http == 9999999-dev
- Installation request for php-pm/php-pm dev-master -> satisfiable by php-pm/php-pm[dev-master].
kugu
@kugu
--- Worker 5501 stderr ---
PHP Fatal error: Class 'React\Http\RequestParser' not found in /git/backend.fb/vendor/php-pm/php-pm/React/RequestParser.php on line 8
Fatal Error: Class 'React\Http\RequestParser' not found in /git/backend.fb/vendor/php-pm/php-pm/React/RequestParser.php:8
part of the problem
current composer install/update - broken
Marc J. Schmidt
@marcj
yeah I guess they broke something
kugu
@kugu
dunno why, but it's installing latest version of react/http
where React\Http\RequestParser are deleted
Martin Lonský
@visitek
\React\Socket\Connection has bufferSize to default 4096... There is no way to set it to higher value... POST data is stripped now
$data = stream_socket_recvfrom($stream, $this->bufferSize);
We send json data, but is is truncated while it is bigger tahn 4096 :(
Martin Lonský
@visitek
Ohh.. it is not needed finally
data are emitted multiply ... incoming data are reading from stream by buffer size.. So before running app in handleRequest should be data collected with reflecting Content-Length
..solved, sorry
Jury
@lcjury
Hi, is php-pm still alive?
Franz Liedke
@franzliedke
@lcjury Yeah, big things are happening here right now: php-pm/php-pm#226
apocello2008
@apocello2008
Hello! I write issue about "Attempted to load class "AppKernel" from the global namespace." 2 weeks ago, but for now don't have any answers. Maybe somebody can help with this error?
apocello2008
@apocello2008

So, i trying setup basic app, based on PSR-7 and Zend\Stratigility. I repeat example from php-pm/php-pm-psr7 but i have error:

 Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: Type error: Argument 2 passed to Zend\Stratigility\MiddlewarePipe::process() must be an instance of Interop\Http\ServerMiddleware\DelegateInterface, null given, called in php-pm/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php on line 86 in php-pm/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php:99

Pls. i need help =(

Adil Houmadi
@AdilHoumadi
Hello, is there any implementation of php-pm for apigility ?
Marc J. Schmidt
@marcj
@AdilHoumadi no, I don’t think so
Adil Houmadi
@AdilHoumadi
Is it possible to receive support questions ? I've run into problem for which I see no possible alternative.
I adapt the php-pm/php-pm-zend to use it with zend apigility, and it seems that the ppm cache requests. here is the output with adapted code
https://gist.github.com/AdilHoumadi/fbf28fe1361c4afc63564f16cdcc3220
Thanks in advance
Marc J. Schmidt
@marcj
@AdilHoumadi ppm does not cache stuff
vuliad
@vuliad
Hello. There are again breaking of composer (
is there any quick workaround now?
i see php-pm/php-pm#283 this was merged for future checkings (strange but ok..)
Richard Hagen
@Richard87
Hi guys! Do you have a recommandation for a replacement for StreamedResponse?
This is what I have now, and I think this is failing in PHP-PM:
    public function createResponse(FilesystemInterface $filesystem): StreamedResponse
    {
        $response = new StreamedResponse();
        $response->headers->makeDisposition(ResponseHeaderBag::DISPOSITION_INLINE,$this->getAsciiFilename());
        $response->headers->set("Content-Type",$this->getMimeType());
        $response->headers->set("Content-Length", $this->getSize());
        $response->setCallback(function () use ($filesystem) {
            $resource = $this->readStream($filesystem);
            fpassthru($resource);
            fclose($resource);
        });
        return $response;
    }
Marc J. Schmidt
@marcj
@Richard87 heyho, I don' think it should fail, it just doen't stream
Richard Hagen
@Richard87
@marcj Hmm, I get an "headers already sent" error when I return a StreamedResponse, and I can't imagine why...
Marc J. Schmidt
@marcj
@Richard87 oh mh, we don't have tests for that, so I don't know. Maybe StreamedResponse prints something to stdout directly
do you see where the output started in the "headers already sent" error?
Richard Hagen
@Richard87
Hi @marcj , thanks for answering :)
Here is the full stacktrace:
string(4217) "Symfony\Component\Debug\Exception\ContextErrorException: Warning: Cannot modify header information - headers already sent by (output started at /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Response.php:1276) in /ppm/vendor/php-pm/httpkernel-adapter/Bridges/HttpKernel.php:231
Stack trace:
#0 /ppm/vendor/php-pm/httpkernel-adapter/Bridges/HttpKernel.php(101): PHPPM\Bridges\HttpKernel->mapResponse(Object(Symfony\Component\HttpFoundation\StreamedResponse))
#1 /ppm/vendor/php-pm/php-pm/src/ProcessSlave.php(406): PHPPM\Bridges\HttpKernel->handle(Object(React\Http\Io\ServerRequest))
#2 /ppm/vendor/php-pm/php-pm/src/ProcessSlave.php(367): PHPPM\ProcessSlave->handleRequest(Object(React\Http\Io\ServerRequest))
#3 /ppm/vendor/react/http/src/Io/MiddlewareRunner.php(52): PHPPM\ProcessSlave->onRequest(Object(React\Http\Io\ServerRequest), Object(Closure))
#4 /ppm/vendor/react/http/src/Io/MiddlewareRunner.php(48): React\Http\Io\MiddlewareRunner->call(Object(React\Http\Io\ServerRequest), 3)
#5 /ppm/vendor/react/http/src/Middleware/RequestBodyParserMiddleware.php(34): React\Http\Io\MiddlewareRunner->React\Http\Io\{closure}(Object(React\Http\Io\ServerRequest))
#6 /ppm/vendor/react/http/src/Io/MiddlewareRunner.php(52): React\Http\Middleware\RequestBodyParserMiddleware->__invoke(Object(React\Http\Io\ServerRequest), Object(Closure))
#7 /ppm/vendor/react/http/src/Io/MiddlewareRunner.php(48): React\Http\Io\MiddlewareRunner->call(Object(React\Http\Io\ServerRequest), 2)
#8 /ppm/vendor/react/http/src/Middleware/RequestBodyBufferMiddleware.php(44): React\Http\Io\MiddlewareRunner->React\Http\Io\{closure}(Object(React\Http\Io\ServerRequest))
#9 /ppm/vendor/react/http/src/Io/MiddlewareRunner.php(52): React\Http\Middleware\RequestBodyBufferMiddleware->__invoke(Object(React\Http\Io\ServerRequest), Object(Closure))
#10 /ppm/vendor/react/http/src/Io/MiddlewareRunner.php(48): React\Http\Io\MiddlewareRunner->call(Object(React\Http\Io\ServerRequest), 1)
#11 /ppm/vendor/react/http/src/Middleware/LimitConcurrentRequestsMiddleware.php(91): React\Http\Io\MiddlewareRunner->React\Http\Io\{closure}(Object(React\Http\Io\ServerRequest))
#12 /ppm/vendor/react/http/src/Io/MiddlewareRunner.php(52): React\Http\Middleware\LimitConcurrentRequestsMiddleware->__invoke(Object(React\Http\Io\ServerRequest), Object(Closure))
#13 /ppm/vendor/react/http/src/Io/MiddlewareRunner.php(40): React\Http\Io\MiddlewareRunner->call(Object(React\Http\Io\ServerRequest), 0)
#14 /ppm/vendor/react/http/src/StreamingServer.php(236): React\Http\Io\MiddlewareRunner->__invoke(Object(React\Http\Io\ServerRequest))
#15 /ppm/vendor/react/http/src/StreamingServer.php(178): React\Http\StreamingServer->handleRequest(Object(React\Socket\Connection), Object(React\Http\Io\ServerRequest))
#16 /ppm/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\Http\StreamingServer->React\Http\{closure}(Object(React\Http\Io\ServerRequest), '')
#17 /ppm/vendor/react/http/src/Io/RequestHeaderParser.php(59): Evenement\EventEmitter->emit('headers', Array)
#18 /ppm/vendor/react/http/src/Io/RequestHeaderParser.php(47): React\Http\Io\RequestHeaderParser->parseAndEmitRequest(792)
#19 /ppm/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\Http\Io\RequestHeaderParser->feed('GET /dashboard/...')
#20 /ppm/vendor/react/stream/src/Util.php(71): Evenement\EventEmitter->emit('data', Array)
#21 /ppm/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(123): React\Stream\Util::React\Stream\{closure}('GET /dashboard/...')
#22 /ppm/vendor/react/stream/src/DuplexResourceStream.php(193): Evenement\EventEmitter->emit('data', Array)
#23 [internal function]: React\Stream\DuplexResourceStream->handleData(Resource id #2619, Object(React\EventLoop\StreamSelectLoop))
#24 /ppm/vendor/react/event-loop/src/StreamSelectLoop.php(236): call_user_func(Array, Resource id #2619, Object(React\EventLoop\StreamSelectLoop))
#25 /ppm/vendor/react/event-loop/src/StreamSelectLoop.php(205): React\EventLoop\StreamSelectLoop->waitForStreamActivity(96262)
#26 /ppm/vendor/php-pm/php-pm/src/ProcessSlave.php(326): React\EventLoop\StreamSelectLoop->run()
#27 /tmp/dbgoOgHAf(25): PHPPM\ProcessSlave->run()
#28 {main}"
[09/Jan/2018:16:46:06 +0000] 127.0.0.1 - - "GET /dashboard/17/download_certificate HTTP/1.0" 500 38 "http://localhost/dashboard/17/"
Marc J. Schmidt
@marcj
and what is in line /var/www/vendor/symfony/symfony/src/Symfony/Component/HttpFoundation/Response.php:1276 ?
Damien Grass
@DGrass
Anyone about? Can't seem to get this working with my Laravel install!
Don't worry. I'm stupid and I fixed my issue.
Ben Johnson
@cbj4074
@DGrass How so? :)
(And what was the issue?)
Sergey
@NBZ4live
Hi. Anybody knows out of the box about issues with php-pm/php-pm-httpkernel and Lumen 5.5?
I get the following error:
Error: Call to undefined method Laravel\Lumen\Application::getProvider() in /ppm/vendor/php-pm/httpkernel-adapter/Bootstraps/Laravel.php:128
Marcelo Gomes
@celogomes_twitter
Hi im trying to use ppm and laravel I get error 500, using this command line docker run -v pwd:/var/www -p 8080:80 phppm/nginx --bootstrap=laravel --static-directory=public/, If I run php artisan serve I dont get error
HDVinnie
@HDVinnie
is this stable for use in laravel 5.6 application?
Ben Johnson
@cbj4074
@HDVinnie :wave: