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

Guzzle FileCookieJar failed to open stream: Permission denied #2198

Closed
phamquangbaoplus opened this issue Nov 15, 2018 · 3 comments
Closed

Comments

@phamquangbaoplus
Copy link

I try to run file_put_contents('cookie.txt', 'content'); stand alone, it OK

The cookie.txt file is 777 chmod

But with guzzle FileCookieJar:

Warning: file_put_contents(cookie.txt): failed to open stream: Permission denied in /home/domain/public_html/includes/guzzle/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php on line 59

Fatal error: Uncaught RuntimeException: Unable to save file cookie.txt in /home/domain/public_html/includes/guzzle/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php:60 Stack trace: #0 /home/domain/public_html/includes/guzzle/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php(39): GuzzleHttp\Cookie\FileCookieJar->save('cookie.txt') #1 [internal function]: GuzzleHttp\Cookie\FileCookieJar->__destruct() #2 {main} thrown in /home/domain/public_html/includes/guzzle/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php on line 60

Please help.

2018-11-15 10_00_57-apkmody c__users_user_phpstormprojects_apkmody - _2bac16a6-75e1-44f0-bc87-5060

@Nyholm
Copy link
Member

Nyholm commented Oct 20, 2019

Every help you need is in the exception message.

You cannot write to "cookie.txt" because of your filesystem's permissions.

@Nyholm Nyholm closed this as completed Oct 20, 2019
@derDeno
Copy link

derDeno commented Oct 22, 2019

I got the same problem and same as phamquangbaoplus my filesystem has chmod 777, so there shouldn't be any problem.

file_put_contents alone works in a separate file but not in combination with guzzle for some reason. Some more help would be really nice because i cant figure it out why it throws this error message.

regards

@Nyholm
Copy link
Member

Nyholm commented Oct 22, 2019

It is about where the file is stored.

Please refer to Stackoverflow or similar to get help.

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

No branches or pull requests

3 participants