This function returns FALSE for files inaccessible due to safe mode restrictions. However these files still can be included if they are located in safe_mode_include_dir.
boas pessoal
Código://... if(file_exists($pathOrigem . $FicheiroOrigem)) //...
Esta instrucção nao me retorna o valor True mesmo existindo o ficheiro.
Alguma razao para isso?
Pode acontecer.
Faz echo de $pathOrigem.$FicheiroOrigem, podes estar a indicar um caminho invalido.
alguém me pode trocar isto em miudos?safe_mode_include_dir string UID/GID checks are bypassed when including files from this directory and its subdirectories (directory must also be in include_path or full path must including).
As of PHP 4.2.0, this directive can take a colon (semi-colon on Windows) separated path in a fashion similar to the include_path directive, rather than just a single directory. The restriction specified is actually a prefix, not a directory name. This means that "safe_mode_include_dir = /dir/incl" also allows access to "/dir/include" and "/dir/incls" if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: "safe_mode_include_dir = /dir/incl/" If the value of this directive is empty, no files with different UID/GID can be included in PHP 4.2.3 and as of PHP 4.3.3. In earlier versions, all files could be included.
[Fri Dec 28 10:19:30 2007] [notice] Apache/2.0.59 (Win32) mod_ssl/2.0.59 OpenSSL/0.9.8a PHP/4.4.3 configured -- resuming normal operations
[Fri Dec 28 10:19:30 2007] [notice] Server built: Jul 21 2006 08:48:52
[Fri Dec 28 10:19:30 2007] [notice] Parent: Created child process 908272
[Fri Dec 28 10:19:32 2007] [notice] Child 908272: Child process is running
[Fri Dec 28 10:19:32 2007] [notice] Child 908272: Acquired the start mutex.
[Fri Dec 28 10:19:32 2007] [notice] Child 908272: Starting 250 worker threads.
[Fri Dec 28 10:19:58 2007] [error] [client 127.0.0.1] PHP Warning: file(C:\\Programas\\sugarcrm-4.5.1e\\htdocs\\sugarcrm\\Filtros_crm_int\\dados\\) [<a href='function.file'>function.file</a>]: failed to open stream: Permission denied in C:\\Programas\\sugarcrm-4.5.1e\\htdocs\\sugarcrm\\Filtros_crm_int\\sync\\importar_facturas.php on line 100
[Fri Dec 28 10:31:21 2007] [error] [client 127.0.0.1] PHP Warning: file(C:\\Programas\\sugarcrm-4.5.1e\\htdocs\\sugarcrm\\Filtros_crm_int\\dados\\) [<a href='function.file'>function.file</a>]: failed to open stream: Permission denied in C:\\Programas\\sugarcrm-4.5.1e\\htdocs\\sugarcrm\\Filtros_crm_int\\sync\\importar_facturas.php on line 100