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

amk's avatar
Level 4

The page has expired due to inactivity?

Hello,guys.. I'am using digital ocean server..

you can upload video file for test here... http://159.65.22.195/file/test

When I uploaded between 5 to 10 Mb video file,It can work well.But if I uploaded over 20 Mb video file, it show error like that

"The page has expired due to inactivity. 

Please refresh and try again."  

I have been change php.ini post_max_size = 2000M upload_max_filesize = 2000M

also I have been try like that

class VerifyCsrfToken extends Middleware
{
    /**
     * The URIs that should be excluded from CSRF verification.
     *
     * @var array
     */
    protected $except = [
    'route'  
    ];
}

after file upload loading is finished show like that "file is required".

sometime,I need to upload nearly 1 GB. Also,I want to make up file uploading speed. anyone can suggest me.pls

here my controller

$file = $request->file('file')
$filename =  $file->getClientOriginalName();
                    $file->move(public_path().'/videos',$filename);
                    
                    $getID3 = new \getID3;

                    $_file = $getID3->analyze('videos/'.$filename);

                    $duration_string = $_file['playtime_string'];

                    // Format string to be 00:00:00
                    $test = $duration_string;
                    if(strlen($test) == 4){
                        $duration = "00:0" . $test;
                    }
                    else if(strlen($test) == 5){
                        $duration = "00:" . $test;
                    }   
                    else if(strlen($test) == 7){
                        $duration = "0" . $test;
                    }

                    $video = Viedo::create([
                       'name' => $name,
                       'viedo_url' => $filename,
                       'time' => $duration
                   ]);
0 likes
14 replies
bwrice's avatar

You probably need to up your "max_execution_time" in your php.ini file and your "fastcgi_read_timeout" in your nginx.conf

amk's avatar
Level 4

now, I am using apache server.I have been change php.ini.... still same error sir @bwrice

amk's avatar
Level 4

anyone pls? I am finding this a week ago. Now,I am getting tired. what wrong is it?

amk's avatar
Level 4

So,what is the problem? server? pls,tell me. If you know, how to fix it? sir @mateoboivinx

Cronix's avatar

Did you restart apache after changing php.ini? How are you running php with your apache setup? As a module or fcgid? What version of Apache? What's the OS? Did you edit the correct php.ini? There could be several.

amk's avatar
Level 4

Yes,I restarted apache.OS is Ubuntu and I changed from etc/php/7.2/cli/php.ini sir @Cronix

Cronix's avatar

Ahh. Well, there are usually 2 versions of php installed. One is for the web, another is for the CLI (like artisan commands use the CLI, but your app uses the web). You changed the one for the CLI (etc/php/7.2/cli/php.ini)

So you need to change the settings for your web version of php.ini, as well.

1 like
amk's avatar
Level 4

and I installed LAMP

Cronix's avatar

To quickly check all of the settings for php that your web server is using, create this route and then visit it in the browser:

Route::get('/phpinfo', function() {
    phpinfo();
});

That will also tell you the location of the php.ini file that your web server is using. Be sure to delete that route when done.

1 like
amk's avatar
Level 4

sir @Cronix So,should I delete /etc/php/7.2/cli/php.ini

I have been change correct path and restared apache but still same error... :(

Cronix's avatar
Cronix
Best Answer
Level 67

No, don't delete that php.ini for the cli, then you'll have other problems.

You edited this file (/etc/php/7.2/apache2/php.ini) and restarted apache?

  1. max_execution_time = 300 (that's 5 minutes, you'll want bigger to upload large files)
  2. max_input_time = 300 (same here)
  3. post_max_size = 10M (you won't be able to upload files (or anything in POST) larger than 10M)
  4. upload_max_filesize = 10M (same as above, except relates to files only)

It seems you didn't edit the right file, or didn't restart the server.

amk's avatar
Level 4

I really thank you Sir @Cronix I am finding this error a week ago, you find within 30mins :) Thank you so much Sir

Please or to participate in this conversation.