Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Building Websites with PHP Slim Basics & Twig Templates Installing Twig

Can't install Twig

I'm having difficulties getting Twig to install via console. I've watched the video closely and I'm following all the steps but it keeps falling over after the prompt to "search for a package".

I hit enter without entering any details at the prompt and get the following :-

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Killed

It then defaults back to the "treehouse;~/workspace$" prompt

I really don't know where I am going wrong and have tried to find documentation on different packages to try but can't seem to find anything.

Any help would be greatly appreciated.

Cheers Don :-)

7 Answers

Got it.

In my workspace I had contact.html files in my file tree at the root level and also under the "templates" folder. I deleted the one at the root level and tried again and voila! :-)

Thanks again for your help Matthew :-)

Matthew Carson
Matthew Carson
5,965 Points

What happens when you type:

composer require twig/twig

into the console? Does it install?

Hey Matthew,

Thanks for replying. I get exactly the same error message that I posted above

Matthew Carson
Matthew Carson
5,965 Points

I think your workspace is running out of memory.

Have you tried making a new workspace and trying it there?

I can't really emulate this problem so don't know how much help I'll be.

Interesting. I'm on my 100th workspace so I might delete a few and see if that changes anything.

Thanks again for the tip :-)

No go unfortunately. I deleted a dozen or so workspaces and I still get the same error message. :-(

John Nixon
John Nixon
17,690 Points

I'm having the same issue, tried using the install method in the video

tried installing this way

composer require twig/twig

my json looks like this

"require": {
        "monolog/monolog": "^1.21",
        "slim/slim": "2.6",
        "twig/twig": "^1.24"
    }

but still getting the "Killed" message when trying to install twig

Ricky Johnston
Ricky Johnston
27,445 Points

I had the same issue here, but using the same version as in the video yielded better results. ~1.18