Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP Request 404 Error #119

Open
PiwanSama opened this issue Nov 24, 2020 · 25 comments
Open

HTTP Request 404 Error #119

PiwanSama opened this issue Nov 24, 2020 · 25 comments

Comments

@PiwanSama
Copy link

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
@JesterIruka
Copy link

Same problem here, but status code 403

@gbrits
Copy link

gbrits commented Dec 8, 2020

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

@JesterIruka
Copy link

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

@valascus
Copy link

valascus commented Dec 26, 2020

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

@miraries
Copy link

miraries commented Jan 9, 2021

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.

@anyforever
Copy link

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

@bmstanley
Copy link

@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

@lorenzocattaneo
Copy link

@miraries check my answer here: #122 (comment)
It may be an easier solution than keeping forks up to date.

@miraries
Copy link

@lorenzocattaneo much better, thanks!

@d3vr
Copy link

d3vr commented Jan 30, 2021

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

php artisan route:clear

or

php artisan optimize:clear

@ctf0
Copy link
Contributor

ctf0 commented Feb 18, 2021

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

@darkguy2008
Copy link

Same here, any updates?

@s4m4n
Copy link

s4m4n commented Apr 22, 2021

Same here. 404

@JeffGepiga
Copy link

same issue here, any updates?

@vlados
Copy link

vlados commented Jun 14, 2021

$ 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

@hefengbao
Copy link

php artisan config:cache
php artisan rotue:cache

@songliqiangcn
Copy link

songliqiangcn commented Nov 10, 2021

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)

@gjm
Copy link

gjm commented Dec 6, 2021

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?

@vlados
Copy link

vlados commented Dec 6, 2021

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

@muhdfaiz
Copy link

Same issue here. Anyone found the solution?

I'm using Laravel 8 and PHP 8.1.

@delejt
Copy link

delejt commented Dec 21, 2021

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

@anyforever
Copy link

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

@YounessTayer
Copy link

YounessTayer commented Aug 12, 2023

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.

@tranvanhieu01012002
Copy link

 Illuminate\Http\Client\RequestException 

  HTTP request returned status code 404:
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, (truncated...)

  at vendor/laravel/framework/src/Illuminate/Http/Client/Response.php:272
    268▕      */
    269▕     public function toException()
    270▕     {
    271▕         if ($this->failed()) {
  ➜ 272▕             return new RequestException($this);
    273▕         }
    274▕     }
    275▕ 
    276▕     /**

      +14 vendor frames 

This is my error, and I updated ``APP_URL=http://localhost``` to correct url -> APP_URL=http://localhost:8000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests