0

Background: Using my own clone (https://github.com/outofcontrol/Laravel4-Vagrant/tree/vmware64) I can bring up--without error--a full functioning Laravel VM with VirtualBox. Using a slightly modified version of the clone (https://github.com/outofcontrol/Laravel4-Vagrant/tree/vmware64 chaining only VM Box in the vagrant file and add COMPOSER_HOME=/home/vagrant to /etc/environment as that was a warning originally) I'm getting a strange error.

The VMware box downloads, installs and is accessible via 'vagrant ssh'. All the modules run up-to laravel_app. Whether I manually run "sudo composer update" directly from the box, or whether Vagrant/Puppet runs it, the following error occurs:

$ sudo composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Generating autoload files
PHP Parse error:  syntax error, unexpected end of file in /var/www/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 954
PHP Stack trace:
PHP   1. {main}() /var/www/artisan:0
PHP   2. require() /var/www/artisan:16
PHP   3. require() /var/www/bootstrap/autoload.php:17
PHP   4. ComposerAutoloaderInitc631e523d6ab3652395fbd23aa1064ba::getLoader() /var/www/vendor/autoload.php:7
Script php artisan clear-compiled handling the post-update-cmd event returned with an error

  [RuntimeException]                                                                                                                                        
  Error Output: PHP Parse error:  syntax error, unexpected end of file in /var/www/vendor/laravel/framework/src/Illuminate/Support/helpers.php on line 954  
  PHP Stack trace:                                                                                                                                          
  PHP   1. {main}() /var/www/artisan:0                                                                                                                      
  PHP   2. require() /var/www/artisan:16                                                                                                                    
  PHP   3. require() /var/www/bootstrap/autoload.php:17                                                                                                     
  PHP   4. ComposerAutoloaderInitc631e523d6ab3652395fbd23aa1064ba::getLoader() /var/www/vendor/autoload.php:7                                               

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [packages1] ... [packagesN]

I've tried for the past few hours several possible fixes, including setting chmod 777 on /var/www, restarting in case of a temporary issue, manually running apt-get update, running apt-get upgrade, lots and lots of googling.

I've verified that the Helper.php file is identical on the working VirtualBox VM and VMware VM.

Software versions on Virtualbox:
    PHP 5.5.5-1+debphp.org~precise+2
    Puppet v2.7.19

Software versions on VMware:
    PHP 5.5.5-1+debphp.org~precise+2
    Puppet v3.0.2

Originally I thought a different version of puppet might cause the issues, but then manually running gets the same errors, I've gotten a bit lost. Would anyone have a suggestion as to what I might try next?

EDIT: Originally I assumed the issue was related to Vagrant and|or Puppet. Further tests show that just mounting the VM machine in VMware and then manually installing and trying to install Laravel produces the same errors.

Out of Control
  • 456
  • 1
  • 6
  • 21
  • If I cd into the VM /var/www and run 'php artisan' I get the above error. If I cd to the same folder on the host (shared from) and run 'php artisan' I get no errors. This suggests that the PHP installation is fubar'd somehow on the VM. – Out of Control Nov 07 '13 at 18:31
  • The Vagrant VMware precise64_vmware box is case insensitive! Arg. Guessing this is the issue. – Out of Control Nov 07 '13 at 18:31

1 Answers1

1

At least if you are using Virtualbox, there is a bug with sendfile -kernel -call that might cause this and other problems that are similar.

My solution would be to move the vendor outside the shared folder, e.g. /home/vagrant/ and then symlink the dir (from the shared folder):

mkdir -p ~/vendor
ln -sf ~/vendor
PHZ.fi-Pharazon
  • 1,479
  • 14
  • 15
  • Thanks, it resolved here after 1 day trying! Using MacOS Catalina, Homestead Updated. Laravel 5.6 with Php7.1 – Leo Moraes Mar 28 '21 at 14:24