Goldeneye Posted December 9, 2008 Share Posted December 9, 2008 Well I fixed that previous problem I had just two days ago which was just a silly mistake of nesting an echo inside an echo. Anyway, I continued to work on my project when I started on user-profiling, and came across this error: <?php Warning: file_exists() [function.file-exists]: Stat failed...<A long string of text (not a directory path)> ?> I searched Google for this error, and I didn't come across anything. The strange thing is that it only errors at a certain length of a string that I assigned to a variable and later passed through a class->function() as a parameter. Example: (this works) <?php $sideb = '<h3>Foobar</h3><p>Hi lol poiasd poiask;l kw psdoif psdl jaeipro a a;ldjsf eopwi rpoawie rlk paoid idpoas dipoaidpa dpoaid paid apodiapoais pdoi dapoid poifc vk;ksdf oepir sodf;lks ;lskfosd ifopisd ropewir pewripoak d;kkljcv;zkljvf oi uerkjsd oirue;ijfl;jf</p>'; $layout->output(array('tpl.sideb' => $sideb)); ?> Example: (this doesn't work, even though the code is same, I just added one character at the beginning of the $sideb string and I get this error. If I take away one character, it behaves (seemingly) perfectly fine). <?php $sideb = 'L<h3>Foobar</h3><p>Hi lol poiasd poiask;l kw psdoif psdl jaeipro a a;ldjsf eopwi rpoawie rlk paoid idpoas dipoaidpa dpoaid paid apodiapoais pdoi dapoid poifc vk;ksdf oepir sodf;lks ;lskfosd ifopisd ropewir pewripoak d;kkljcv;zkljvf oi uerkjsd oirue;ijfl;jf</p>'; $layout->output(array('tpl.sideb' => $sideb)); ?> So, my question is: What does this error mean, in general? Link to comment https://forums.phpfreaks.com/topic/136166-yet-another-seemingly-cryptic-warning-message-from-php/ Share on other sites More sharing options...
kenrbnsn Posted December 9, 2008 Share Posted December 9, 2008 PHP errors usually have a line number associated with them. Please show use the entire error message. Also please post the code for the output() function. Ken Link to comment https://forums.phpfreaks.com/topic/136166-yet-another-seemingly-cryptic-warning-message-from-php/#findComment-710275 Share on other sites More sharing options...
redarrow Posted December 9, 2008 Share Posted December 9, 2008 you got a L there in front m8.... $sideb = 'L<h3>Foobar</h3><p>Hi lol poiasd poiask;l kw psdoif psdl jaeipro a a;ldjsf eopwi rpoawie rlk paoid idpoas dipoaidpa dpoaid paid apodiapoais pdoi dapoid poifc vk;ksdf oepir sodf;lks ;lskfosd ifopisd ropewir pewripoak d;kkljcv;zkljvf oi uerkjsd oirue;ijfl;jf</p>'; Link to comment https://forums.phpfreaks.com/topic/136166-yet-another-seemingly-cryptic-warning-message-from-php/#findComment-710284 Share on other sites More sharing options...
corbin Posted December 9, 2008 Share Posted December 9, 2008 stat is a system function, and it only fails under certain conditions: The stat() function shall fail if: [EACCES] Search permission is denied for a component of the path prefix. [EIO] An error occurred while reading from the file system. [ELOOP] A loop exists in symbolic links encountered during resolution of the path argument. [ENAMETOOLONG] The length of the path argument exceeds {PATH_MAX} or a pathname component is longer than {NAME_MAX}. [ENOENT] A component of path does not name an existing file or path is an empty string. [ENOTDIR] A component of the path prefix is not a directory. [EOVERFLOW] The file size in bytes or the number of blocks allocated to the file or the file serial number cannot be represented correctly in the structure pointed to by buf. The stat() function may fail if: [ELOOP] More than {SYMLOOP_MAX} symbolic links were encountered during resolution of the path argument. [ENAMETOOLONG] As a result of encountering a symbolic link in resolution of the path argument, the length of the substituted pathname string exceeded {PATH_MAX}. [EOVERFLOW] A value to be stored would overflow one of the members of the stat structure. From http://www.opengroup.org/onlinepubs/000095399/functions/stat.html So, chances are, the file doesn't exist, or you don't have the correct permissions on it. Link to comment https://forums.phpfreaks.com/topic/136166-yet-another-seemingly-cryptic-warning-message-from-php/#findComment-710290 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.