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

Composer/Slim on shared hosting - how much of a pain, and is it necessary?

So, I'm going through the PHP track, and we're to the point of using composer and slim. I like the idea, but its been nothing short of terrible trying to get any of this to work on my shared hosting server.

I did, after much trial and error, get composer installed, but now when i try to use it I either get a 'no input file' error, or simply no response and just a new prompt.

I'm good with HTML/CSS/JS/JQ, but how necessary are these frameworks to construct clean PHP, clean URL, submit forms, etc. How much of this can be done pure? I've googled a bit, but if anyone has a quick answer that would be very helpful.

Part of the problem on my shared solution is permissions. Permissions issues everywhere, and permissions i can't modify. I'd love to add composer to usr/local/bin, but i cant even do that.

I was really getting into the PHP stuff too, but if i can't use the stuff they're teaching, its really gonna take the wind out of my sails. At least a pure solution would be nice.

5 Answers

jason chan
jason chan
31,009 Points

you can edit permissions in your ftp account.

composer is package handler. Like ruby gems. You download frameworks and libraries to do things. Just install xampp and composer.

You can drag and drop the files from your computer into the ftp server. Then download your sql database and upload your sql database onto your shared host.

It's a lot of trouble, but teamtreehouse doesn't teach cpanel or linux administration they do they basics of console which is ssh. Well your shared hosting won't give your own linux box. So your kind of stuck talking to the IT department for help. Chmod CHOWN. Tough stuff.

The whole point of composer is download libraries and frameworks from a repository. It's mostly for laravel and slim. I think it's easier on linux and mac. Windows is troublesome.

php and databases are trouble. LOLs.

It has mysql built in, so I should be good there. I've tried using ftp instead of ssh, just get permissions errors. Haven't had any luck with child either. I really hope I can find a solution. I certainly can't be the first of their customers to want to use composer or something.

Thanks for the reply.

In case I didn't say above, it's an apache server on a Linux box

jason chan
jason chan
31,009 Points

.htaccess is the devil you'll see. LOLs.

I ended up changing the php version from their default (5.4) to 5.6. Apparently you can't edit settings (at least not easily) on the default version, but if you select a different version you have better control.

So switched to 5.6, then everything, including the composer install, went smoothly. Able to run it properly now. Thanks for the help