Changes

From SME Server
Jump to navigationJump to search
1,038 bytes added ,  17 July
Line 474: Line 474:  
This is made tricky as we do not have the PHP CLI configured.
 
This is made tricky as we do not have the PHP CLI configured.
   −
But we can install it as follows with command line arguments. This is using php74.
+
But we can install it as follows with command line arguments. This is using php7. Check the latest hash file as this changes.
    
Download:
 
Download:
Line 484: Line 484:  
Install:
 
Install:
 
  php74 -d allow_url_fopen=on  ./composer-setup.php
 
  php74 -d allow_url_fopen=on  ./composer-setup.php
 +
 +
=== Bash script===
 +
 +
Add the code:
 +
 +
nano composer.install
 +
 +
Paste this:
 +
 +
if [ ! -d '/tmp/compose' ]; then
 +
    /usr/bin/mkdir -p /tmp/compose
 +
    cd /tmp/compose
 +
else
 +
    cd /tmp/compose
 +
fi
 +
 +
# Get the setup file
 +
/usr/bin/php74 -d allow_url_fopen=on -r "copy('https://getcomposer.org/installer', '/tmp/compose/composer-setup.php');"
 +
 +
# Hash check
 +
/usr/bin/php74 -r "if (hash_file('sha384', '/tmp/compose/composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('/tmp/compose/composer-setup.php'); } echo  PHP_EOL;"
 +
 +
# Install
 +
/usr/bin/php74 -d allow_url_fopen=on  /tmp/compose/composer-setup.php
 +
mv /tmp/compose/composer.phar /usr/local/bin/composer
 +
 +
# Tidy
 +
rm -rf /tmp/compose
 +
 +
Save and exit.
 +
 +
Run it:
 +
 +
chmod 0700 composer.install
 +
./composer.install
 +
 +
Check ths file is there:
 +
 +
ll /usr/local/bin/composer
 +
 +
Use with
 +
 +
php74 composer <blah>
    
=== Bugs ===
 
=== Bugs ===

Navigation menu