0

Several of my PHP (7.2) apps stopped working this morning if they use include_once or require_once, but they worked fine yesterday. The same code also works fine on the same server, but other domains with minimal difference in vhost configs and no htaccess files (Apache 2.4). Also, things work if I chase down the error and remove “_once” from everything. I’ve been using PHP for almost 20 years and never seen anything like this. The error I get looks like the following, but it happens for any include_once/require_once. (Nothing has changed on the server as far as I can tell since this code was working, and the same code bas works fine on our dev server.)

include_once(): Failed opening ‘/whatever_path/whatever_file.php’ for inclusion (include_path=’.:/usr/share/php’) in /another_path/another_file.php on line 24

Dave
  • 5,108
  • 16
  • 30
  • 40
  • Some things I already checked... open_basedir is not set. I don't see anything unusual in the logs, except that it looks like the issue started right after the last logroate this morning at 6:25 am (eastern). I have also looked at all files modified within the vhost root since it was last working, and there is nothing out of the usual. – Larry Elliott Jun 07 '19 at 14:21
  • Maybe server has changed filesystem structure? May be the folders/files are not on the server where you remember now? – Alessandro Jun 07 '19 at 15:48
  • Give a try... `require_once($_SERVER['DOCUMENT_ROOT'] . "/your_folder/your_php_file.php");` – Alessandro Jun 07 '19 at 15:53
  • File structure is the same. I should have mentioned this is not a hosted system. I have full control of the server. I think we may have found an actual bug. For now, we are removing _once from all of our apps as a work around. Thanks for the input. – Larry Elliott Jun 07 '19 at 17:25

0 Answers0