2

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.

Community
  • 1
  • 1
sqren
  • 22,833
  • 7
  • 52
  • 36
  • 1
    If you copy the files in a external HD or a pendrive, instead of using vm-tools? – Hackerman May 29 '13 at 13:39
  • Good idea! Yes, no problem if the files are stored on a USB drive which is mounted directly to the guest. Does this give you any clues, how to solve the problem? – sqren May 31 '13 at 08:33

2 Answers2

2

I have this problem with VMWare too - whenever I do a composer update or dump-autoload, I have to restart the VM, which takes care of the problem. Until the next update...

This seems to be a somewhat known problem, but unfortunately I haven't found any solution yet.

For more information:

https://github.com/composer/composer/issues/1365

https://superuser.com/questions/511679/getting-an-error-trying-to-set-up-shared-folders-on-an-ubuntu-instance-of-vmware/522337#522337

https://stackoverflow.com/a/14407758/847856

Community
  • 1
  • 1
0

This issue has been resolved, at least for me, as of VMware 6.0.2. I simply upgraded VMware Fusion to 6.0.2 and the problem disappeared.

Out of Control
  • 456
  • 1
  • 6
  • 21
  • 3
    I'm still seeing EOF errors when running php composer updates using 6.0.2. Found this post today because now random other files are seeing EOF errors as well, possibly after a git update or branch change. – James Alday Jan 29 '14 at 17:44
  • A bit late, but perhaps try NSF, it fully resolves this issue. – Out of Control Sep 15 '14 at 14:40