Re: is_executable() ???

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

 



Al wrote:
clearstatcache();
if(is_executable(PATH_TO_SOURCE_DIR . $filename)
{
code
}

Always returns true for:
foo.jpg
foo.php
foo.sh

And even if I feed it a non existing file.

Really?

<?php
$file = 'blah.de.blah';
echo 'file exists: ' . is_file($file) . "\n";
echo 'is exec: ' . is_executable($file) . "\n";
?>

file exists:
is exec:


Check the permissions on those files through ftp or ssh. Are they 755 or are they 644 ?

If they are 755 (or 775 or 777) then they are actually executable files. Whether you get a valid result from that or not is entirely separate but in *nix you could make a .txt file executable and it won't care.

--
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