Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Real path always returning false

Tags:

php

I have a problem with the PHP realpath always returning false how ever I pass the file path string.

By default I pass this the the realpath() "/shop/templates/default/css/reset.css", I have also tried:

  • http://localhost/shop/templates/default/css/reset.css

What could be causing this to break?

like image 839
John Magnolia Avatar asked Dec 22 '22 08:12

John Magnolia


1 Answers

Are you sure you have the correct path? It probably doesn't start with /shop in the filesystem.

Are your permissions correct?

realpath() requires:

  1. That the file / path actually exist.
  2. Read permission for the entire directory hierarchy.

realpath() doesn't work with URLs.

like image 195
jasonbar Avatar answered Dec 24 '22 00:12

jasonbar