0

I'm currently running a shared server with the multi PHP manager cPanel extension, so I'm trying to install Laravel 5.7, but I get the following exception:

Could not find package laravel/laravel with version 5.7.* in a version installable using your PHP version 5.6.38.

But when I run php -v, it outputs the following:

PHP 7.2.11 (cli) (built: Oct 30 2018 20:57:09) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.2.4, Copyright (c) 2002-2018, by ionCube Ltd.

And if I do a phpinfo(), I get the following version:

PHP Version 7.0.32

So, as you can see all 3 versions are different and I don't know what is going on, any ideas?

NOTE: I don't have super user permissions, when I run commands with sudo I get the following : sudo: effective uid is not 0, is sudo installed setuid root?

Aarón Gutiérrez
  • 1,400
  • 3
  • 16
  • 41
  • find in phpinfo() output page the loaded .ini config file and go from there – treyBake Nov 07 '18 at 16:07
  • The php.ini path is the following: `/opt/cpanel/ea-php70/root/etc/php.ini`, but why does the exception thrown says I'm at 5.6.38? – Aarón Gutiérrez Nov 07 '18 at 16:11
  • How did you run composer? Have you tried setting a target PHP version like documented at https://stackoverflow.com/questions/45847258/use-php-7-to-run-composer-but-install-packages-for-php-5 – Nico Haase Nov 07 '18 at 16:19
  • 1
    @NicoHaase For installing the project I ran the folllowing command: `composer create-project laravel/laravel="5.7.*" myProject` because I wanted to force 5.7 installation (if I ran the command with prefer dist it would install 5.4). Now, if I add the platform on the composer file I get the following error when running `composer update`: `syntax error, unexpected '?' in myProject/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 233` – Aarón Gutiérrez Nov 07 '18 at 16:28
  • Have you tried changing the PHP version from your cPanel, if you can? The PHP version your CLI uses is ultimately determined by which version it finds first in your $PATH variable, but your webserver doesn't run it this way and needs to be set explicitly. Laravel 5.7 requires PHP >= 7.1.3 – Travis Britz Nov 08 '18 at 02:30
  • 1
    @TravisBritz Yeah, I think I will be stucked with this specific server, since I would need to restart apache in order to make the web server use PHP 7.2.11 and I don't have the right permissions to do it. I think I will need to install the project on a lower Laravel version and dependencies in my local machine and then upload it, – Aarón Gutiérrez Nov 08 '18 at 15:25

0 Answers0