Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php5.6 #187

Open
electrototo11 opened this issue Jan 11, 2016 · 11 comments
Open

php5.6 #187

electrototo11 opened this issue Jan 11, 2016 · 11 comments
Assignees
Labels

Comments

@electrototo11
Copy link

Hi,
The program works with PHP5.5 but no longer works in 5.6, 403 error on my script :(
How I can do ?
Thanks

@Clement87
Copy link

Same issue, any update ?

@themattharris
Copy link
Owner

the 403 will be coming back from Twitter with some message explaining what the cause of the 403 was.
if you inspect $tmhOAuth->response i can suggest possible causes and investigate further.

@Clement87
Copy link

Thanks for the quick reply but I put my production back in PHP 5.5 and don't have an other environment to test it. Maybe @electrototo11 can inspect the response ?

@electrototo11
Copy link
Author

Hi,
The response is only : KO (403), no more...
PHP version : 5.6.17

@Clement87
Copy link

By the way, the problem only occurs (at least for me) when posting a tweet with a picture. Simple tweets (only text) was OK.

@electrototo11
Copy link
Author

yes, same for me

@johannesnagl
Copy link

we have this library working with php 5.6 for weeks now - no problem at all. as @themattharris pointed out, please have a look at the error message concerning your api call!

@themattharris
Copy link
Owner

can you var_dump $tmhOAuth->response and share what it says

@ik0
Copy link

ik0 commented Oct 11, 2016

Hello,
I had the same problem - after upgrade from php 5.5 to 7.0 tweets with picture stopped work with error 189
var_dump(json_decode($tmhOAuth->response['response'])) gives:

object(stdClass)#6 (1) {
["errors"]=>
array(1) {
[0]=>
object(stdClass)#4 (2) {
["code"]=>
int(189)
["message"]=>
string(22) "Error creating status."
}
}
}

To fix the problem I changed how attach image. I've changed this line

'media[]' => "@{$image};type=image/png;filename={$image}",

with

'media[]' => file_get_contents($image),

and now it's works.
I don't know is this a change in twitter or PHP or somewhere else. Hope this will help someone.

@electrototo11
Copy link
Author

I try now it's works ! Perfect ! thanks ik0.

@MarcosBL
Copy link

MarcosBL commented May 2, 2017

Working fine, thanks @ik0 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants