Re: file_exists() not working correctly?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




That worked like a charm. Now, can you tell me why that exact same function
works with a relative path on another server and with a "full path only" on
this server? I am glad that it works, but would also like to understand why
:o)

Could be different document roots for apache, different environment settings, lots of things.

If you have a config variable for the base folder of your app, try to use that.

If you don't, then work out the path relative to the file this function is in.

$mydir = dirname(__FILE__);
$path_to_folder = $mydir . '/../../images/....';

That way it's relative to the file the function is in and you don't have to change it each time you put it on a new server.

--
Postgresql & php tutorials
http://www.designmagick.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux