Php 错误:服务器错误:无法打开文件“Capture.png”

Php 错误:服务器错误:无法打开文件“Capture.png”,php,api,file-upload,twitter,Php,Api,File Upload,Twitter,我想在twitter上发布一张图片,但我不能。我只能用twitter API发布短信 错误是:错误:服务器错误:无法打开文件Capture.png 我使用wamp服务器。图片与脚本位于同一文件夹中 问题在哪里? require_once '../src/twitter.class.php'; // ENTER HERE YOUR CREDENTIALS (see readme.txt) $twitter = new Twitter. ('raQBedybFLb', 'HWgN6Qt11jg0L

我想在twitter上发布一张图片,但我不能。我只能用twitter API发布短信

错误是:错误:服务器错误:无法打开文件Capture.png

我使用wamp服务器。图片与脚本位于同一文件夹中

问题在哪里?
require_once '../src/twitter.class.php';

// ENTER HERE YOUR CREDENTIALS (see readme.txt)
$twitter = new Twitter. ('raQBedybFLb', 'HWgN6Qt11jg0LY', '862846056-ndeGfMA83r9ldh', 'VMBvHDahXnGp');
$p='./Capture.png';
try {
$tweet = $twitter->send('testing twitter api', $p); // you can add $imagePath as second argument

} catch (TwitterException $e) {
echo 'Error: ' . $e->getMessage();
}

您可以使用$p=realpath'Capture.png'

是$p='./Capture.png';还是Capture.png?您同时使用了这两个选项。Is$p='./Capture.png';图片与脚本位于同一文件夹中。如果我将C:/Users/CCA/Pictures/picture.jpg$p=realpath'Capture.png',使用$p.Works时会出现相同的错误;作品