In the __destruct method, first do echo getcwd(); , and you will see the current working directory at this stage, I am sure that it has been changed at this point.
For example, if your class is defined in a file located in a different directory than your main script, the request will refer to a file that defines the class.
It is always a good idea to define a constant containing the base directory of your script. So, somewhere in the first lines of your main php file add.
define('rootdir', dirname(__FILE__));
Then each time you add or require a file that is relative to your main script file.
include rootdir. '/requires/include.php';
eg.
user912695
source share