beh Posted December 10, 2007 Share Posted December 10, 2007 Hi Everyone, Quick questions. I've recently installed the latest version of PHP running on IIS 6 (XP Pro). When running the following the following code: function getFile($vFile) { if (function_exists('file_get_contents')) { $vString = @file_get_contents ($vFile); } else { $vString = implode('', @file($vFile)); } if (!$vString) { echo "[$vFile] does not exist."; exit; } else return $vString; } When $vFile is a relative path it fails. When using an absolute path it works fine. This is consistent across all file commands including is_file etc. Can anyone help? I presume that this is something to do with an ini setting or iis? Regards, Paul Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 10, 2007 Share Posted December 10, 2007 You would need to give an example of a link that works and one that does not work. It is likely you are writing it incorrectly. Are you trying relative file system paths or URL's? A file system path is relative to the current working directly of the main script that is running. Using a URL in php function that normally operates on file system paths, requires a fully qualified URL (http://domain/path/file) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.