laravel-opcache icon indicating copy to clipboard operation
laravel-opcache copied to clipboard

HTTP Request 404 Error

Open PiwanSama opened this issue 4 years ago • 25 comments

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

PiwanSama avatar Nov 24 '20 18:11 PiwanSama

Same problem here, but status code 403

JesterIruka avatar Dec 04 '20 13:12 JesterIruka

Same issue here:

Configuration cache cleared!
Configuration cached successfully!

   Illuminate\Http\Client\RequestException 

  HTTP request returned status code 404.

  at vendor/laravel/framework/src/Illuminate/Http/Client/Response.php:207
    203|      */
    204|     public function throw()
    205|     {
    206|         if ($this->serverError() || $this->clientError()) {
  > 207|             throw new RequestException($this);
    208|         }
    209| 
    210|         return $this;
    211|     }

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

gbrits avatar Dec 08 '20 05:12 gbrits

I solved the 403 (It was cloudflare issue) but I still with 404, I just gave up at this point

JesterIruka avatar Dec 09 '20 16:12 JesterIruka

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

valascus avatar Dec 26 '20 16:12 valascus

ME TOO.Ver:3.2.1

php artisan opcache:clear

The requested URL returned error: 404 Not Found Url: https://domain/opcache-api/clear?key=eyJpdiI6ImtaV3FMbys0TmZjYjNLM0RwUG9vaFE9PSIsInZhbHVlIjoiK3RyNGFRbk8zZWZ6dXJRcWdRTHFKZz09IiwibWFjIjoiNzUwZjVhZDg2MTA5NDVhMGY5YTcyYWZiZmRhZGJiMTVhOThiM2E1NTE5MGJlM2FhZGZiZWU5OWY3YjE4MWIzYSJ9

anyforever avatar Jan 09 '21 08:01 anyforever

I had no issues with opcache:clear, but did get a a 500 on opcache:compile with the following error: ParseError: syntax error, unexpected '|', expecting '{' in file /var/www /var/www (truncated...)

In case someone has a similar problem, I traced it down to symfony/polyfill-intl-idn and other polyfills. Seems like it was loading it's bootstrap80.php files instead of bootstrap.php despite PHP_VERSION_ID being under 80000. For now I'm just using local forks which don't have the bootstrap80.php files but should probably investigate further.

miraries avatar Jan 09 '21 12:01 miraries

$ php artisan vendor:publish --provider="Appstract\Opcache\OpcacheServiceProvider" --tag="config" Copied File [\vendor\appstract\laravel-opcache\config\opcache.php] To [\config\opcache.php] Publishing complete. and set 'verify_ssl' => false, 'verify_host' => 0, // 0 for disabled

It's working well.

anyforever avatar Jan 10 '21 01:01 anyforever

@anyforever I tried to apply these settings to my project and it had no effect. I am running PHP 7.4.13 on Ubuntu 18.04

bmstanley avatar Jan 11 '21 06:01 bmstanley

@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.

lorenzocattaneo avatar Jan 13 '21 11:01 lorenzocattaneo

@lorenzocattaneo much better, thanks!

miraries avatar Jan 23 '21 11:01 miraries

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

php artisan route:clear

or

php artisan optimize:clear

d3vr avatar Jan 30 '21 16:01 d3vr

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()

ctf0 avatar Feb 18 '21 03:02 ctf0

Same here, any updates?

darkguy2008 avatar Mar 19 '21 04:03 darkguy2008

Same here. 404

s4m4n avatar Apr 22 '21 18:04 s4m4n

same issue here, any updates?

JeffGepiga avatar Apr 26 '21 01:04 JeffGepiga

$ php artisan vendor:publish --provider="Appstract\Opcache\OpcacheServiceProvider" --tag="config" Copied File [\vendor\appstract\laravel-opcache\config\opcache.php] To [\config\opcache.php] Publishing complete. and set 'verify_ssl' => false, 'verify_host' => 0, // 0 for disabled

It's working well.

As mentioned add this to the config, then clear any cached config with php artisan optimize and then try to recompile the opcache

vlados avatar Jun 14 '21 11:06 vlados

php artisan config:cache
php artisan rotue:cache

hefengbao avatar Jun 16 '21 09:06 hefengbao

Same issue here:

In Response.php line 260:

  HTTP request returned status code 404:
  <!DOCTYPE html>
  <html lang="en">
  <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width (truncated...)


Tried below still doesn't work

$ php artisan vendor:publish --provider="Appstract\Opcache\OpcacheServiceProvider" --tag="config" Copied File [\vendor\appstract\laravel-opcache\config\opcache.php] To [\config\opcache.php] Publishing complete.
and set
'verify_ssl' => false, 'verify_host' => 0, // 0 for disabled

Laravel Framework 8.55.0 PHP 7.4.3 nginx version: nginx/1.18.0 (Ubuntu)

songliqiangcn avatar Nov 10 '21 00:11 songliqiangcn

I'm also having this issue...

In my local machine everything works fine. In production server I get 404.

My server is behind a load balancer so I'm using http://localhost as OPCACHE_URL. If I try to get any other url, using wget, I get the correct status. But if I try to access /opcache-api/* I get 404.

I've tried clearing cache, routes, config, etc... No luck...

I've tried setting 'verify_ssl' => false in config/opcache.php. Still no luck...

I'm stuck... Anyone has any ideas?

gjm avatar Dec 06 '21 15:12 gjm

did you try clear cache and config? Are you getting 404 or 500? Look at error logs when you try to compile

vlados avatar Dec 06 '21 18:12 vlados

Same issue here. Anyone found the solution?

I'm using Laravel 8 and PHP 8.1.

muhdfaiz avatar Dec 16 '21 17:12 muhdfaiz

Hi For 404 - Make sure your APP_URL is set correctly in .env. For 503 - use anyforever solution

delejt avatar Dec 21 '21 09:12 delejt

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

anyforever avatar May 07 '22 06:05 anyforever

I solved this problem by upgrading my laravel installer to version 4, I did it by simply running the following command line :

composer global require "laravel/installer:^4.0"

Thanks for master Elias MISSAOUI who suggested to me this solution.

YounessTayer avatar Aug 12 '23 17:08 YounessTayer