laravel-opcache: HTTP Request 404 Error

I just installed opcache and get the following error when I to run:

  • php artisan opcache:clear

  • php artisan opcache:config

  • php artisan opcache:status

 HTTP request returned status code 404:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found (truncated...)

  at C:\wamp64\www\BeautyGo\vendor\laravel\framework\src\Illuminate\Http\Client\Response.php:231
    227▕     {
    228▕         $callback = func_get_args()[0] ?? null;
    229▕
    230▕         if ($this->failed()) {
  ➜ 231▕             throw tap(new RequestException($this), function ($exception) use ($callback) {
    232▕                 if ($callback && is_callable($callback)) {
    233▕                     $callback($this, $exception);
    234▕                 }
    235▕             });

  1   C:\wamp64\www\BeautyGo\vendor\appstract\laravel-opcache\src\Commands\Clear.php:34
      Illuminate\Http\Client\Response::throw()

  2   C:\wamp64\www\BeautyGo\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:37
      Appstract\Opcache\Commands\Clear::handle()

I’m using:

  • Laravel 8.10.0
  • WAMP Server 3.2.2.2

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 6
  • Comments: 24 (1 by maintainers)

Most upvoted comments

Please clear your php code opcache use other methods, or restart your php-fpm. Because your php code opcache data is created. So the new router ( opcache-api/clear ) can’t find. @bmstanley @darkguy2008 @s4m4n @theonly27 @gjm @muhdfaiz @vlados @delejt

503 in here


   Illuminate\Http\Client\RequestException 

  HTTP request returned status code 503:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
  <meta charset="UTF-8" />
  <meta http-equiv="Content-Type" content="text/ht (truncated...)

  at vendor/laravel/framework/src/Illuminate/Http/Client/Response.php:241
    237▕     {
    238▕         $callback = func_get_args()[0] ?? null;
    239▕ 
    240▕         if ($this->failed()) {
  ➜ 241▕             throw tap(new RequestException($this), function ($exception) use ($callback) {
    242▕                 if ($callback && is_callable($callback)) {
    243▕                     $callback($this, $exception);
    244▕                 }
    245▕             });

      +14 vendor frames 
  15  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

In my case it was cached routes, so just run:

php artisan route:clear

or

php artisan optimize:clear

@miraries check my answer here: https://github.com/appstract/laravel-opcache/issues/122#issuecomment-759400723 It may be an easier solution than keeping forks up to date.

Same issue here (404) Works for localhost tho, but in production, with the APP_URL correct, it doesn’t.