RobertGrubb / tiktok-php

TikTok scraper in PHP
MIT License
63 stars 21 forks source link

Fatal error: failed to open stream: No such file or directory in __DIR__ . '/env.php' #31

Closed sarabhi92git closed 4 years ago

sarabhi92git commented 4 years ago

Hi @RobertGrubb , I am getting error failed to open stream: No such file or directory env.php

You set env.php in examples/videos.php and when I run that I get error env.php file not found. /**

The file is not there as it is not present in your release.

RobertGrubb commented 4 years ago

It's not present on purpose. You need to create the env.php with the following:

<?php 

return [
  'cookiesFile' => __DIR__ . '/cookies.json'
];

Or you can instantiate the scraper like so:

new Scraper([
  'cookiesFile' => __DIR__ . '/cookies.json'
]);

All that's happening in those lines is including a config file.

sarabhi92git commented 4 years ago

Thank you so much @RobertGrubb !

I got the point.