php
php copied to clipboard
Authentication Using Firebase Admin SDK for PHP
After deployment on vercel and tried to login to my apps, it shows the below message:
The token is invalid: file_put_contents(/var/task/user/storage/framework/cache/data/24/fc/24fc69d48eaa682f929a7045e8f4700237c0083e): Failed to open stream: No such file or directory
Is this because of the php runtime trying to write files on vercel but it has no permission or what?
Yes. You have to use /tmp for cache or logs.
Can you suggest any ways to handle that?
is it add cache handler at vercel.json env field?

Using ENV is great way. Is it working correctly?

I have added cache path, but now the session is missing when I try to assess $_SESSION, where should session path locate?

the session and cache path I set.
but got this error

to solve this error I have tried to set build scripts at package.json to
- make new folder `tmp/sessions
- set the permission
- and list all file at
/tmpfolder (below is the vercel build log)
Which step did I did wrong, is it the path for sessions is set wrong?
There is only /tmp path. If you need deeper structure, you have to create somehow. For example /tmp/sessions, because php will not create /tmp/sessions itself.
fyi I have already make a build script in package.json:

and run it in vercel.json:

and it actually ran when building vercel runtime:
