ebelendez
ebelendez

Reputation: 908

Installing Laravel 4 using composer.phar without terminal access

I don't have a shell or command line terminal to install composer.phar, what can I do? Is there any other way?

Upvotes: 4

Views: 5231

Answers (2)

tolgamorf
tolgamorf

Reputation: 809

I had a similar situation with my hosting company. Even though I had an SSH access, the PHP installed in the SSH environment was 5.2.17 and I couldn't install composer. The web server itself had PHP 5.4 and I have managed to find a workaround and got Composer and Laravel 4 installed by running a PHP file on the web server.

For Laravel 4 to work, you need at least PHP 5.3 along with some required extensions, i.e. MCRYPT. You can check your PHP version and other related information via the phpinfo() function.

The PHP file I used to get Laravel installed is below. Copy composer.phar to your Laravel installation path.

<?php

putenv('COMPOSER_HOME=' . '/path/to/laravel');

$command = '/usr/local/php54/bin/php-cli /path/to/laravel/composer.phar install -d /path/to/laravel';
$output =  system($command . ' 2>&1');
echo('<pre>' . $command . "\n" . $output);

?>

I had to use a full path for the php command line, because the default php was pointing to the old version, 5.2.17. Thus, you may not need the full path. If you do, adjust the path accordingly.

I hope that it helps.

Upvotes: 3

Alexandre Butynski
Alexandre Butynski

Reputation: 6746

You can just download composer.phar, put it in your application root (near the composer.json file) and then run :

php composer.phar install

On Windows there is also a composer.exe installer available.

Upvotes: 2

Related Questions