note 60246 modified in function.dl by danbrown

From: Date: Sat, 19 Jul 2008 23:37:00 +0000
Subject: note 60246 modified in function.dl by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-141797@lists.php.net to get a copy of this message
just some note to loading modules, they do not have to be executable. some examples below check for this but if an module is not executable is does not mean you cant use it. it just needs to be readable NOT executable. although some modules might need this perhaps for some reason i cannot think of, so here an example, <?php // fails to load mysql although it could be loaded. if(is_executable("mysql.so")){ dl("mysql.so"); } // loads mysql if(is_readable("mysql.so")){ dl("mysql.so"); } ?> watch out with this, as you can see mysql.so would not be loaded and the script would fail. because its checked for executable permissions although these are not needed. --was-- just some note to loading modules, they do not have to be executable. some examples below check for this but if an module is not executable is does not mean you cant use it. it just needs to be readable NOT executable. although some modules might need this perhaps for some reason i cannot think of, so here an example, // fails to load mysql although it could be loaded. if(is_executable("mysql.so")){ dl("mysql.so"); } // loads mysql if(is_readable("mysql.so")){ dl("mysql.so"); } watch out with this, as you can see mysql.so would not be loaded and the script would fail. because its checked for executable permissions although these are not needed. http://php.net/manual/en/function.dl.php

« previous php.notes (#141797) next »