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

编程入门 行业动态 更新时间:2024-10-17 09:45:30
本文介绍了错误:服务器错误:无法打开文件“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”

本文发布于:2023-07-26 23:59:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1219102.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   无法打开   服务器   文件   png

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!