In my setup source files are located on the host machine (Mac OSX) and shared to the guest (Ubuntu Server). When files are added to the host from the guest, syntax errors will occur on the last line of the file - even though no syntax errors are present.
Example: Laravel Artisan commands
All of the following commands are run from the Ubuntu (guest)
First time, this will work fine:
php artisan
I can also rebuild the source files just fine:
php artisan dump-autoload
However, as the files have been rebuilt, this no longer works:
php artisan
... and results in this syntax error:
PHP Parse error: syntax error, unexpected 'F' in /mnt/hgfs/www/tmi/api/vendor/composer/autoload_classmap.php on line 1646
The problem disappears if I remount the folder with the source code:
sudo mount /mnt/hgfs/www
Now I can again run the following without problems:
php artisan
My setup
- My host is Mac OSX where all source files are located.
- My guest OS is Ubuntu Server (non-gui) where php is installed.
- Files are shared from host to guest with open-vm-tools (vmhgfs)
I am very open to any suggestion you might have, and if you need details please ask.