- Aer Version (or commit ref):
- Operating System: Linux
- System Architecture (eg. arm, x86_64, ...): x86_64
Your problem description
When relative path is passed as argument to include alike function, it looks for source file in current directory (.). When first source file is opened, it should change working directory to it. This way, script will behave in the same way, independent on CWD.
Example directory structure:
<?php require_once 'a.php'; ?>
<?php echo 'Hello World'; ?>
If our current working directory (CWD) is ~/binary and we call ./psharp ../test.php it will not find a.php. However, if we change directory to ~ and call ./binary/psharp test.php it will work just fine.