When did md5_file and copy require absolute URIs?

256 Views Asked by At

I'm working on a Laravel 4 based project. I recently migrated to Laravel's Forge, where suddenly all of my relative URI based function calls to "copy" and "md5_file" suddenly stopped working. The solution I found on my own was to replace them all with absolute function calls, which has worked so far. However:

  • I have no idea what/why happened
  • I don't have any way of predicting what other changes may be required.

If it helps, my previous stack was PHP 5.4.9-4ubuntu2.4 via apache and forge uses PHP 5.5.15-1+deb.sury.org~trusty+1 via nginx.

So I don't know if this is a PHP thing, Apache vs nginx thing, or Laravel Forge thing.

Basically, the following code:

if (file_exists($file_uri) && is_readable($file_uri))
{
    return md5_file($file_uri);
}
return null;

produced the following exception:

md5_file($file_uri): failed to open stream: No such file or directory

BUT, that exception is only occuring on my Forge/NginX/PHP server with non-absolute URIs.

0

There are 0 best solutions below