• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Laravel 5.5 with PHP 7+ install dependencies

Michael Lauwereys

New Pleskian
Hello there,

I'm running into a bit of problems to get my Laravel 5.5 project to work. This is what I did.

I use Git to add my GitHub rep. to my website directory.
My website is running PHP 7.1 (checked with phpinfo())

Now to get everything to work I have to install all the dependencies. Normally I do this in Plesk by using the "Scan" option in "Applications" and this works fine. However it only installs like half of them. So I checked with SSH and did a composer install and because Plesk (the vendor) is running on PHP 5.4.16 it doesn't want to install the dependencies (they require PHP 7+).

Is there an easy way to fix this?

Thanks,
Michael
 
Hi Michael Lauwereys,

Plesk (the vendor) is running on PHP 5.4.16
Plesk is not the vendor of your serverwide PHP version, it is for example CentOS, Debian, Ubuntu...

You leave us in the dark, what operating system you use and what Plesk version ( incl. #MU ) you use. :(
You leave out as well corresponding log - entries from your log - files, so that people willing to help you would have something to start with the investigations. :(
You leave out your used commands and the corresponding outputs from your command line, which would help as well to investigate your issue.


Pls. check as well the following ( external ) links, for further suggestions and recommendations:

=> Laravel Installation Using Composer on a Plesk Server | Nublue

=> Use different PHP version CLI executable for one command

... and pls. keep in mind, that you should consider to ask "Laravel" - related questions at for example: => Laracasts Web Development Forum

or/and at the forum:

=> Home Forum > General Discussion > Open Topics
 
Hello,

Thank you for the reply. Sorry for not providing the information you needed.

Version Plesk Onyx v17.5.3_build1705170317.16 os_CentOS 7
OS CentOS Linux 7.2.1511 (Core)

Website PHP version: 7.1.9 (when doing phpinfo()
1AAUHIivRjG0VAMXNURoEw.png


PHP version when doing php -v: PHP 5.4.16 (cli) (built: Nov 6 2016 00:29:02)
cJEXBanZSmq0s03AVCQPqQ.png


Git (extension) Version: 1.1.0-213

First I tried installing the dependencies through the Application menu (followed this one: Managing PHP Project Dependencies with Composer). This works, however not everything is installed.
Then I tried it through the terminal with command: composer install and there I see it sees the os php version which is 5.4. Is there a way to let it know only this website is running on 7.1?

I also tried something like: PATH="/opt/plesk/php/7.1/bin:$PATH" php /usr/bin/composer install
but then I get:

Code:
-bash-4.2$ env PATH="/opt/plesk/php/7.1/bin:$PATH" php /usr/bin/composer install
# Copyright 1999-2017. Parallels IP Holdings GmbH. All Rights Reserved.
COMPOSER_BIN="/usr/lib64/plesk-9.0/composer.phar"

[ -e "$COMPOSER_BIN" ] || { echo "'$COMPOSER_BIN' not found" >&2; exit 1; }
[ -x "$COMPOSER_BIN" ] || { echo "'$COMPOSER_BIN' is not executable" >&2; exit 1; }

"$COMPOSER_BIN" "$@"

Note: I'm pulling my Laravel project from GitHub. I'm not creating one from scratch in Plesk.
Also it's running on a sub domain.

Code:
-bash-4.2$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - This package requires php >=7.0.0 but your PHP version (5.4.16) does not satisfy that requirement.
  Problem 2
    - Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
    - doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 3
    - Installation request for filp/whoops 2.1.10 -> satisfiable by filp/whoops[2.1.10].
    - filp/whoops 2.1.10 requires php ^5.5.9 || ^7.0 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 4
    - Installation request for phar-io/manifest 1.0.1 -> satisfiable by phar-io/manifest[1.0.1].
    - phar-io/manifest 1.0.1 requires php ^5.6 || ^7.0 -> your PHP version (5.4.16) does not satisfy that requirement.
  Problem 5
    - Installation request for phar-io/version 1.0.1 -> satisfiable by phar-io/version[1.0.1].
    - phar-io/version 1.0.1 requires php ^5.6 || ^7.0 -> your PHP version (5.4.16) does not satisfy that requirement.
...

Kind regards,
Michael
 
Hi Michael Lauwereys,

pls. try to use:
Code:
mkdir -p /root/addons/PHP/composer
followed by
Code:
cd /root/addons/PHP/composer
followed by
Code:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
followed by
Code:
/opt/plesk/php/7.1/bin/php composer-setup.php

... if you desire to install the composer with Plesk PHP 7.1 for example and use the composer with for example:
Code:
/opt/plesk/php/7.1/bin/php /root/addons/PHP/composer/composer.phar command [options] [arguments]
 
Back
Top