我用的管理工具是composer,代碼完全複製人家的example。但是就是有下面這個error:
Fatal error: require(): Failed opening required '/vendor/autoload.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in /Applications/XAMPP/xamppfiles/htdocs/test.php on line 3
require 'vendor/autoload.php';use Icicle\Loop;Loop\timer(1, function () { // Executed after 1 second.echo "First.\n";Loop\timer(1.5, function () { // Executed after 1.5 seconds. echo "Second.\n";});echo "Third.\n";Loop\timer(0.5, function () { // Executed after 0.5 seconds. echo "Fourth.\n";});echo "Fifth.\n";});echo "Starting event loop.\n";Loop\run();
回複內容:
我用的管理工具是composer,代碼完全複製人家的example。但是就是有下面這個error:
Fatal error: require(): Failed opening required '/vendor/autoload.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in /Applications/XAMPP/xamppfiles/htdocs/test.php on line 3
require 'vendor/autoload.php';use Icicle\Loop;Loop\timer(1, function () { // Executed after 1 second.echo "First.\n";Loop\timer(1.5, function () { // Executed after 1.5 seconds. echo "Second.\n";});echo "Third.\n";Loop\timer(0.5, function () { // Executed after 0.5 seconds. echo "Fourth.\n";});echo "Fifth.\n";});echo "Starting event loop.\n";Loop\run();
看看路徑是不是寫錯了。。。
很可能就是引用的路徑有問題了,可以看到在對應的目錄下是否有對應的檔案,既然絕對路徑都列印出來了
在你的framework 裡面先載入 vendor下的autoload.php