Check if File Exists with PHP

    Check if File Exists with PHP

    Hi,

    i would like to use PHP in PaloWeb to check if a file exists.

    I was able to do this outside of PaloWeb with the following PHP code:

    PHP Source Code

    1. <?php
    2. $filename = 'C:\\boot.ini';
    3. clearstatcache();
    4. if (file_exists($filename)) {
    5. echo "The file $filename exists";
    6. } else {
    7. echo "The file $filename does not exist";
    8. }
    9. ?>



    however similar code in PaloWeb always returns the file does not exist.

    What I read here i need to add the folder to the macro_engine_config.xml

    I tried this already without success, attached the first rows of the config file:

    XML Source Code

    1. <?xml version="1.0" encoding="utf-8"?>
    2. <php_macro_engine_config xmlns="http://www.jedox.com/jedox/wss" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    3. <php_extensions directory="php_extensions">
    4. <extensions>
    5. <extension extension_file="php_curl.dll" />
    6. <extension extension_file="phpchartdir530.dll" />
    7. <extension extension_file="php_jedox_palo.dll" />
    8. <extension extension_file="php_fileinfo.dll" />
    9. <extension extension_file="libphp_jedox_palo.so" />
    10. </extensions>
    11. </php_extensions>
    12. <php_files directory="../httpd/app" temp_directory="tmp">
    13. <include_paths>
    14. <include_path path="base" relative="true" />
    15. <include_path path="lib" relative="true" />
    16. <include_path path="lib/jpgraph" relative="true" />
    17. <include_path path="c:\" relative="false" />
    18. </include_paths>
    19. </php_files>


    and my code I use:

    Source Code

    1. function check_msg(){
    2. clearstatcache();
    3. $filename = 'C:\\boot.ini';
    4. if (file_exists($filename )) {
    5. return __msgbox ("The file $filenam2 exists", 'FileExitst', 'Info');
    6. } else {
    7. return __msgbox ("The file $filenam2 does not exist", 'FileNotExitst', 'Info');
    8. }
    9. }


    What I'm doing wrong?
    Maik Nammert