PHP | is_executable( ) Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report The is_executable() function in PHP is an inbuilt function which is used to check whether the specified file is an executable file or not. The name of the file is sent as a parameter to the is_executable() function and it returns True if the file is an executable file else it returns False. Syntax: bool is_executable($file) Parameters Used: The is_executable() function in PHP accepts one parameter. $file: It is a mandatory parameter which specifies the file. Return Value: It returns True if the file is an executable file else it returns false. Exceptions An E_WARNING is emitted on failure. The result of this function are cached and therefore the clearstatcache() function is used to clear the cache. is_executable() function returns false for non-existent files. Below programs illustrate the is_executable() function. Program 1: php <?php $myfile = "gfg.exe"; // checking whether the file is // an executable file or not if (is_executable($myfile)) echo ("$myfile: executable!"); else echo ("$myfile: not executable!"); ?> Output: gfg.exe is executable! Program 2 php <?php // fileperms() function returns the // permission as a number on success // or FALSE on failure $permissions = fileperms("gfg.exe"); $permvalue = sprintf("%o", $permissions); // checking whether the file is executable // or not if (is_executable("gfg.exe")) echo ("Executable file and File " "Permissions are : $permvalue"); else echo ("Not Executable file and File " "Permissions are : $permvalue"); ?> Output: Executable file and File Permissions are : 0644 Reference: https://www.php.net/manual/en/function.is-executable.php Create Quiz Comment S Shubrodeep Banerjee Follow 0 Improve S Shubrodeep Banerjee Follow 0 Improve Article Tags : Misc Web Technologies PHP PHP-file-handling PHP-function +1 More Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like