错误:服务器错误:无法打开文件“Capture.png” [英] Error: Server error: couldn't open file "Capture.png"

查看:162
本文介绍了错误:服务器错误:无法打开文件“Capture.png”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在twitter上发布图片,但是我不能。

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



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



问题在哪里?


  require_once'../src/twitter.class.php'; 

//在此输入您的凭据(请参阅readme.txt)
$ twitter = new Twitter。 ('raQBedybFLb','HWgN6Qt11jg0LY','862846056-ndeGfMA83r9ldh','VMBvHDahXnGp');
$ p ='。/ Capture.png';
try {
$ tweet = $ twitter-> send('testing twitter api',$ p); //你可以添加$ imagePath作为第二个参数

catch(TwitterException $ e){
echo'Error:'。 $ E->的getMessage();


解决方案

$ c> $ p = realpath('Capture.png');


I want to post an image on twitter but I can't. I am able to post only text message with twitter API.

The error is: Error: Server error: couldn't open file "Capture.png"

I use wamp server. The picture is in the same folder with the script.

Where is the problem?

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();
}

解决方案

You may use $p = realpath('Capture.png');

这篇关于错误:服务器错误:无法打开文件“Capture.png”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆