Install Laravel 4 using composer.phar without access to the terminal

I do not have a shell or command line to install composer.phar, what can I do? Is there another way?

+4
source share
2 answers

I had a similar situation with my hosting company. Despite the fact that I had access to SSH, PHP installed in the SSH environment was 5.2.17 and I could not install the composer. The web server itself had PHP 5.4, and I managed to find a workaround, and it installed Composer and Laravel 4, running the 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 version of PHP and other related information using the phpinfo() function.

The PHP file I used to install Laravel 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 the full path for the php command line, because by default php 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 this helps.

+3
source

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

 php composer.phar install 

Composer.exe installer is also available on Windows.

+2
source

Source: https://habr.com/ru/post/1484985/


All Articles