Symfony Exception

TypeError

HTTP 500 Internal Server Error

feof(): Argument #1 ($stream) must be of type resource, bool given

Exception

TypeError

  1. function getFileRowCount($filename)
  2. {
  3.     $file fopen($filename"r");
  4.     $rowCount 0;
  5.     while (!feof($file)) {
  6.         fgets($file);
  7.         $rowCount++;
  8.     }
  9.     fclose($file);
  1. function getFileRowCount($filename)
  2. {
  3.     $file fopen($filename"r");
  4.     $rowCount 0;
  5.     while (!feof($file)) {
  6.         fgets($file);
  7.         $rowCount++;
  8.     }
  9.     fclose($file);
  1.     $host = isset($parsedUrl['host']) ? $parsedUrl['host'] : '';
  2.     $path = isset($parsedUrl['path']) ? $parsedUrl['path'] : '';
  3.     $baseUrl $scheme "://" $host $path;
  4.     $urlAsli str_replace("get-sitemap.php"""$baseUrl);
  5.     $judulFile "list.txt";
  6.     $jumlahBaris getFileRowCount($judulFile);
  7.     $sitemapFile fopen("sitemap.xml""w");
  8.     fwrite($sitemapFile'<?xml version="1.0" encoding="UTF-8"?>' PHP_EOL);
  9.     fwrite($sitemapFile'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' PHP_EOL);
  10.     $fileLines file($judulFileFILE_IGNORE_NEW_LINES FILE_SKIP_EMPTY_LINES);
  11.     foreach ($fileLines as $index => $judul) {
  1.         if (! isset($files['app'])) {
  2.             throw new Exception('Unable to load the "app" configuration file.');
  3.         }
  4.         foreach ($files as $key => $path) {
  5.             $repository->set($key, require $path);
  6.         }
  7.     }
  8.     /**
  9.      * Get all of the configuration files for the application.
  1.         // directory and load each one into the repository. This will make all of the
  2.         // options available to the developer for use in various parts of this app.
  3.         $app->instance('config'$config = new Repository($items));
  4.         if (! isset($loadedFromCache)) {
  5.             $this->loadConfigurationFiles($app$config);
  6.         }
  7.         // Finally, we will set the application's environment based on the configuration
  8.         // values that were loaded. We will pass a callback which will be used to get
  9.         // the environment in a web context where an "--env" switch is not present.
  1.         $this->hasBeenBootstrapped true;
  2.         foreach ($bootstrappers as $bootstrapper) {
  3.             $this['events']->dispatch('bootstrapping: '.$bootstrapper, [$this]);
  4.             $this->make($bootstrapper)->bootstrap($this);
  5.             $this['events']->dispatch('bootstrapped: '.$bootstrapper, [$this]);
  6.         }
  7.     }
  1.      * @return void
  2.      */
  3.     public function bootstrap()
  4.     {
  5.         if (! $this->app->hasBeenBootstrapped()) {
  6.             $this->app->bootstrapWith($this->bootstrappers());
  7.         }
  8.     }
  9.     /**
  10.      * Get the route dispatcher callback.
  1.     {
  2.         $this->app->instance('request'$request);
  3.         Facade::clearResolvedInstance('request');
  4.         $this->bootstrap();
  5.         return (new Pipeline($this->app))
  6.                     ->send($request)
  7.                     ->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
  8.                     ->then($this->dispatchToRouter());
  1.         $this->requestStartedAt Carbon::now();
  2.         try {
  3.             $request->enableHttpMethodParameterOverride();
  4.             $response $this->sendRequestThroughRouter($request);
  5.         } catch (Throwable $e) {
  6.             $this->reportException($e);
  7.             $response $this->renderException($request$e);
  8.         }
Kernel->handle(object(Request)) in /home/smkmvpsc/public_html/index.php (line 53)
  1. $app = require_once __DIR__ '/bootstrap/app.php';
  2. $kernel $app->make(Kernel::class);
  3. $response $kernel->handle(
  4.     $request Request::capture()
  5. )->send();
  6. $kernel->terminate($request$response);

Stack Trace

TypeError
TypeError:
feof(): Argument #1 ($stream) must be of type resource, bool given

  at /home/smkmvpsc/public_html/config/saos/kecap/get-sitemap.php:7
  at feof(false)
     (/home/smkmvpsc/public_html/config/saos/kecap/get-sitemap.php:7)
  at getFileRowCount('list.txt')
     (/home/smkmvpsc/public_html/config/saos/kecap/get-sitemap.php:26)
  at require('/home/smkmvpsc/public_html/config/saos/kecap/get-sitemap.php')
     (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php:70)
  at Illuminate\Foundation\Bootstrap\LoadConfiguration->loadConfigurationFiles(object(Application), object(Repository))
     (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php:39)
  at Illuminate\Foundation\Bootstrap\LoadConfiguration->bootstrap(object(Application))
     (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:242)
  at Illuminate\Foundation\Application->bootstrapWith(array('Illuminate\\Foundation\\Bootstrap\\LoadEnvironmentVariables', 'Illuminate\\Foundation\\Bootstrap\\LoadConfiguration', 'Illuminate\\Foundation\\Bootstrap\\HandleExceptions', 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders', 'Illuminate\\Foundation\\Bootstrap\\BootProviders'))
     (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176)
  at Illuminate\Foundation\Http\Kernel->bootstrap()
     (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:160)
  at Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(object(Request))
     (/home/smkmvpsc/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:134)
  at Illuminate\Foundation\Http\Kernel->handle(object(Request))
     (/home/smkmvpsc/public_html/index.php:53)