Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Amphop图书馆在xampp上工作,但在我的webhoster上不工作_Php_Asynchronous_Parallel Processing_Amphp - Fatal编程技术网

Php Amphop图书馆在xampp上工作,但在我的webhoster上不工作

Php Amphop图书馆在xampp上工作,但在我的webhoster上不工作,php,asynchronous,parallel-processing,amphp,Php,Asynchronous,Parallel Processing,Amphp,我想并行执行数组中的域。它可以工作,但只能通过xampp,而不能在我的Web主机上工作。为什么? 我用这个: 代码: 在我的webhoster上运行时出现错误代码: 池中的工作程序意外退出,代码为-1,位于vendor/amhp/parallel/lib/Worker/DefaultPool.php上的第250行 池中的工作程序意外退出,代码为-1,第250行打开 致命错误:未捕获Amp\Process\ProcessException:无法在/kunden/559288_442/webs

我想并行执行数组中的域。它可以工作,但只能通过xampp,而不能在我的Web主机上工作。为什么?

我用这个:

代码:


在我的webhoster上运行时出现错误代码:

池中的工作程序意外退出,代码为-1,位于vendor/amhp/parallel/lib/Worker/DefaultPool.php上的第250行 池中的工作程序意外退出,代码为-1,第250行打开


致命错误:未捕获Amp\Process\ProcessException:无法在/kunden/559288_442/webseiten/webhoster/parallel/vendor/amphip/Process/lib/Internal/Posix/Runner.php中列出打开的文件描述符。php:142堆栈跟踪:#0/kunden/559288_442/webseiten/webhoster/parallel/vendor/amphip/Process/lib/Internal/Posix/Runner.php(88):Amp\Process\Internal\Posix\Runner->generateFds()#1/kunden/559288_442/webseiten/webhoster/parallel/vendor/amphop/Process/lib/Process.php(108):Amp\Process\Internal\Posix\Runner->start('{('/usr/bin/ph.,'',数组,数组)#2[内部函数]:Amp\Process Process Process Process Process->Process Process Process{closure}()#3/kunden/559288_442/webseiten/webhoster/parallel/vendor/ampp/amp/lib/Coroutine.php(67):Generator->current()#4/kunden/559288_442/webseiten/webhoster/parallel/vendor/ampp/lib/functions.php(96):amp\Coroutine->构建(对象(生成器))#5/kunden/559288_442/webseiten/webhoster/parallel/vendor/ampp/lib/process/process/process.php(110):Amp\call(对象(闭包))第202行的#6/kunden/4 in/kunden/559288442/webseiten/webhoster/parallel/vendor/amfp/parallel/lib/Context/Process.php根据提供的信息,您在web主机服务器上的用户没有读取Amp读取的路径以查找文件描述符所需的权限。这是一种疏忽

据我所知(通过阅读Amp源代码),当您的web主机不支持线程时,创建进程是最后的选择,这对于所有共享主机提供商来说都是非常标准的

用于异步读取文件。我过去能够在共享主机上成功地使用它,即使它也会创建子进程。幸运的是,它创建子进程的方式不需要访问共享主机环境中通常受保护的目录

<?php

require dirname(__DIR__) . '/vendor/autoload.php';

// With Amp loop;
// $loop = new Amp\ReactAdapter\ReactAdapter((new Amp\Loop\DriverFactory)->create());

// With React EventLoop;
$loop = \React\EventLoop\Factory::create();

$filesystem = \React\Filesystem\Filesystem::create($loop);

// This returns a react/promise, which can be yielded in amp coroutines
$filesystem->file(__FILE__)->getContents()->then(function ($contents) {
    echo $contents, PHP_EOL;
}, function ($e) {
    echo $e->getMessage(), PHP_EOL;
});

// You only need this if you are running outside of an Amp Loop.
$loop->run();

<?php

require dirname(__DIR__) . '/vendor/autoload.php';

// With Amp loop;
// $loop = new Amp\ReactAdapter\ReactAdapter((new Amp\Loop\DriverFactory)->create());

// With React EventLoop;
$loop = \React\EventLoop\Factory::create();

$filesystem = \React\Filesystem\Filesystem::create($loop);

// This returns a react/promise, which can be yielded in amp coroutines
$filesystem->file(__FILE__)->getContents()->then(function ($contents) {
    echo $contents, PHP_EOL;
}, function ($e) {
    echo $e->getMessage(), PHP_EOL;
});

// You only need this if you are running outside of an Amp Loop.
$loop->run();