composer install run demo script got error
kcloze opened this issue · comments
composer.json
{
"require": {
"hprose/hprose-swoole": "dev-master"
}
}
index.php
<?php
require_once 'vendor/autoload.php';
use Hprose\Swoole\Http\Server;
function hello($name)
{
return "Hello $name!";
}
$server = new Server('http://0.0.0.0:8000');
$server->add('hello');
$server->debug
php index.php get error as blow:
php index.php
PHP Warning: require(/media/sf_php/test/hprose_demo/vendor/composer/../hprose/hprose/src/Hprose.php): failed to open stream: No such file or directory in /media/sf_php/test/hprose_demo/vendor/composer/autoload_real.php on line 66
PHP Fatal error: require(): Failed opening required '/media/sf_php/test/hprose_demo/vendor/composer/../hprose/hprose/src/Hprose.php' (include_path='.:/usr/share/php') in /media/sf_php/test/hprose_demo/vendor/composer/autoload_real.php on line 66
你这不是人家代码的问题 是你用了虚拟机的共享文件夹 应该是没有权限或者路径问题
应该是composer安装不完整,composer update之后好了