I am using Unit with PHP, and running into an issue where if the script is using a symlink, I get an error "script is not under php root".
My unit configuration is:
{
"applications": {
"exphp74": {
"type": "php 7.4",
"user": "nobody",
"processes": 2,
"root": "/var/www/html",
"script": "app/start.php"
}
},
"listeners": {
"*:8374": {
"application": "exphp74"
}
}
}
/var/www/html/app is a symlink to /tmp/app. When I try to apply the above configuration, I get "Failed to apply new configuration." and unit.log has "script is not under php root".
My guess is because realpath is returning the actual path to the file even though it's also under the root through a symlink.
Is there a way to have Unit still consider it as under the php root even though it's a symlink?
I did notice that if I create /var/www/html/app as a real directory with start.php in it, apply the configuration, and then switch it back to a symlink, then all works correctly.
Thanks for your help.
I am using Unit with PHP, and running into an issue where if the script is using a symlink, I get an error "script is not under php root".
My unit configuration is:
/var/www/html/app is a symlink to /tmp/app. When I try to apply the above configuration, I get "Failed to apply new configuration." and unit.log has "script is not under php root".
My guess is because realpath is returning the actual path to the file even though it's also under the root through a symlink.
Is there a way to have Unit still consider it as under the php root even though it's a symlink?
I did notice that if I create /var/www/html/app as a real directory with start.php in it, apply the configuration, and then switch it back to a symlink, then all works correctly.
Thanks for your help.