Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rameezisrar's avatar

Profile Photo Update failure

Unable to update a profile picture On console i get this error :

POST https://me.grel.org/settings/photo 422 ()
dispatchXhrRequest @ app.js:559
tryCallTwo @ app.js:52488
doResolve @ app.js:52643
Promise @ app.js:52509
xhrAdapter @ app.js:396
dispatchRequest @ app.js:964
tryCallOne @ app.js:52480
(anonymous) @ app.js:52566
flush @ app.js:197
characterData (async)
requestCall @ app.js:292
rawAsap @ app.js:161
handleResolved @ app.js:52556
handle @ app.js:52552
./node_modules/promise/lib/core.js.Promise.then @ app.js:52520
request @ app.js:791
Axios.(anonymous function) @ app.js:811
wrap @ app.js:1198
update @ app.js:71778
invoker @ app.js:58681
fn._withTask.fn._withTask @ app.js:58480

Also i am forcing https loads in AppServiceProvider under the boot method

    if (App::environment('production', 'staging'))
        {
            URL::forceScheme('https');
        } 
0 likes
8 replies
biishmar's avatar

@abudo if u r forcing https then do it in server or .htaccess file.

1 like
Cronix's avatar

I use forceScheme as well, but it's not 100%. I also rewrite http to https at the server level to guarantee all bases are covered and haven't had an issue with that setup for ssl.

However, that doesn't seem to be the issue. It's issuing a 422 status code, which usually is a form validation error. I'm not sure why spark isn't picking it up and displaying the error.

Does it always fail? Have you tried using different images?

1 like
rameezisrar's avatar

@Cronix Yes i have tried with different image types and sizes but i am getting the same error

rameezisrar's avatar

@Cronix the error says :

protected function methodNotAllowed(array $others)
    {
        throw new MethodNotAllowedHttpException($others);
    }
rameezisrar's avatar

@Cronix I haven't run this command on the production server

php artisan storage:link

Do i need to run this command on the production server too

rameezisrar's avatar
rameezisrar
OP
Best Answer
Level 18

@Cronix tmp path was empty in php.ini file. That's how I got it fixed.

Please or to participate in this conversation.