This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use Stack Overflow.

Install Error 2.6.1 - defineDirectoryStructure()

Discuss installing Symfony 2 here

Install Error 2.6.1 - defineDirectoryStructure()

by MGSteve » Thu Dec 04, 2014 10:48 am

I've just setup a plain Vagrant box with Symfony, all the prerequistes are present and it has Ubuntu 14.01 LTS on it.

This worked earlier in the week but now doesn't so something's changed somewhere, but I can't understand what.

This is the VagrantFile (trimmed down for brevity),
Code: Select all
.
.
.
  config.vm.box = "ubuntu/trusty64"
.
.
.

  # Update the list of packages
  config.vm.provision :shell, :inline => "sudo apt-get update -y"

  # Install Apache - Note, you'll have to setup the vhost config (for now)
  config.vm.provision :shell, :inline => "sudo apt-get install apache2 -y"

  # Composer needs git...
  config.vm.provision :shell, :inline => "sudo apt-get install git -y"

  # Asset install needs java
  config.vm.provision :shell, :inline => "sudo apt-get install default-jre-headless -y"

  # Download & configure CURL
  config.vm.provision :shell, :inline => "sudo apt-get install curl -y"

  # Download & configure PHP
  config.vm.provision :shell, :inline => "sudo apt-get install php5 php5-xdebug php5-intl php5-mysql php5-dev make -y"

  # Download & install mySQL client
  config.vm.provision :shell, :inline => "sudo apt-get install mysql-client-core-5.5 -y"

  # Lastly setup symfony, get the name of the project folder & use that as the name to create in /var/www/
  $setupName = File.basename(Dir.getwd).downcase;
  config.vm.provision :shell, :inline => "/vagrant/provision/setup_symfony.sh $1", args:$setupName;

end


setup_symfony.sh contains... (it does a bit more, but this is the relevant bit, right at the top of the file)

Code: Select all
installDir=/var/www/${1}
newProject=0

echo "Install Directory Set to ${installDir}"

if [ -d ${installDir} ]; then
  newInstall=0
else
  newInstall=1
  echo "New Install Detected"
fi

if [ ${newInstall} ]; then
    # Setup engage directories
    sudo mkdir -p ${installDir}
    sudo chown vagrant:vagrant ${installDir}
    chmod +rw ${installDir}/

    # Download composer
    cd ${installDir}
    curl -sS https://getcomposer.org/installer | php
    sudo chmod 755 ./composer.phar
    sudo mv composer.phar /usr/local/bin/composer

    # Are we Creating a New Project

    if [ ! -e /vagrant/web ]; then
        newProject=1
        echo "New Project Detected, run this to install the latest Symfony"
        echo "composer create-project symfony/framework-standard-edition ."
        exit
    fi


but when composer finishes installing Symfony, I get this error:
Code: Select all
PHP Fatal error:  Call to undefined method Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::defineDirectoryStructure() in /var/www/master/app/SymfonyStandard/RootPackageInstallSubscriber.php on line 28
PHP Stack trace:
PHP   1. {main}() /usr/local/bin/composer:0
PHP   2. require() /usr/local/bin/composer:25
PHP   3. Composer\Console\Application->run() phar:///usr/local/bin/composer/bin/composer:43
PHP   4. Symfony\Component\Console\Application->run() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:83
PHP   5. Composer\Console\Application->doRun() phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:126
PHP   6. Symfony\Component\Console\Application->doRun() phar:///usr/local/bin/composer/src/Composer/Console/Application.php:145
PHP   7. Symfony\Component\Console\Application->doRunCommand() phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:195
PHP   8. Symfony\Component\Console\Command\Command->run() phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:874
PHP   9. Composer\Command\CreateProjectCommand->execute() phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:252
PHP  10. Composer\Command\CreateProjectCommand->installProject() phar:///usr/local/bin/composer/src/Composer/Command/CreateProjectCommand.php:129
PHP  11. Composer\Installer->run() phar:///usr/local/bin/composer/src/Composer/Command/CreateProjectCommand.php:168
PHP  12. Composer\EventDispatcher\EventDispatcher->dispatchCommandEvent() phar:///usr/local/bin/composer/src/Composer/Installer.php:330
PHP  13. Composer\EventDispatcher\EventDispatcher->doDispatch() phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:120
PHP  14. call_user_func:{phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:158}() phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:158
PHP  15. SymfonyStandard\RootPackageInstallSubscriber->setupNewDirectoryStructure() phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:158


Anyone had this before and knows what to do. In the mean time I'm going to try rolling back an SF version
MGSteve
Junior Member
 
Posts: 1
Joined: Thu Dec 04, 2014 10:36 am