In a PHP cli script I'm writing I need to change the path for the user that's running the script. The destination path is not fixed.
The script will be used on machines running on Ubuntu. With a bash script I could use sourcing, but that doesn't seem to work with PHP scripts. When I try that, the hashbang referring to the php binary at the top of the script is ignored and the script interpreted as a bash script. I don't really know what else to try.
Is there some way to achieve this?
chdir(or any other function for that matter) to modify the parent shell.