Welcome Guest, Not a member yet? Register   Sign In
installing CI4 via Composer, but getting error, please help!
#1
Question 
(This post was last modified: 10-26-2020, 01:44 AM by zoldos.)

I tried the composer command right above my project root to install CI4, but got this:

Code:
Could not find package codeigniter4/appstarter with stability stable in a version installable using your PHP version 7.0.33

I'm using PHP 7.3.+ and nowhere in my Plesk setup do I see anything about PHP 7.0.33.  I'm running Ubunto 16.04, Plesk 18, and Apache.  All my sites are using 7.3.

Please help! Huh

Okay, update, I got this with php -v in console:

Code:
PHP 7.0.33-0ubuntu0.16.04.7 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with the ionCube PHP Loader + ionCube24 v10.4.0, Copyright (c) 2002-2020, by ionCube Ltd.
    with Zend OPcache v7.0.33-0ubuntu0.16.04.7, Copyright (c) 1999-2017, by Zend Technologies

But my sites clearly use PHP 7.3+. Any ideas??
Reply
#2

CodeIgniter 4 requires php version 7.2 or higher with intl extension.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

(10-26-2020, 07:38 AM)InsiteFX Wrote: CodeIgniter 4 requires php version 7.2 or higher with intl extension.

Yes I know.  All my sites appear to be running PHP 7.3.22, but in console, php -v reports it as 7.0.33 and I don't know how to upgrade it. Sad  I did this in php.ini: extension=intl

What now?
Reply
#4

(10-26-2020, 07:48 AM)zoldos Wrote:
(10-26-2020, 07:38 AM)InsiteFX Wrote: CodeIgniter 4 requires php version 7.2 or higher with intl extension.

Yes I know.  All my sites appear to be running PHP 7.3.22, but in console, php -v reports it as 7.0.33 and I don't know how to upgrade it. Sad  I did this in php.ini: extension=intl

What now?

this is not related to CI you just need to config your machine with CI requirements.

You need to give us some information regarding your system.
What OS are you using? are you on a server or desktop? Huh

Run the following commands and send us the result.

Quote:$ locate bin/php

$ sudo ls -la /etc/php*

$ sudo find / -name php | grep bin

you are having multiple PHPs on your machine, your Apache server is configured to run your website on your PH7.3 but your CLI php is not.
You have to find the right binary file to your PHP7.3 and set it as default php command.
Reply
#5

It's a dedicated server running Ubunto 16.04.7 LTS, Apache2, and Plesk 18.

Here's the results of those commands:

condor1310:~# locate bin/php
/opt/plesk/php/7.3/bin/php
/opt/plesk/php/7.3/bin/php-cgi
/opt/plesk/php/7.3/bin/phpdbg
/opt/plesk/php/7.3/sbin/php-fpm
/opt/psa/admin/bin/php
/opt/psa/admin/bin/php_handlers_control
/opt/psa/admin/bin/php_modules_ctl
/opt/psa/admin/bin/phpcfg
/opt/psa/admin/bin/phpinimng
/opt/psa/admin/sbin/php_handlers_control
/opt/psa/admin/sbin/php_modules_ctl
/opt/psa/admin/sbin/phpcfg
/opt/psa/admin/sbin/phpinimng
/opt/psa/bin/php-cli
/opt/psa/bin/php_handler
/opt/psa/bin/php_settings
/usr/bin/php
/usr/bin/php-cgi
/usr/bin/php-cgi7.0
/usr/bin/php7.0
/usr/lib/cgi-bin/php
/usr/lib/cgi-bin/php7.0
/usr/sbin/php-fpm7.0
/usr/sbin/phpdismod
/usr/sbin/phpenmod
/usr/sbin/phpquery

condor1310:~# ls -la /etc/php*
total 20
drwxr-xr-x 3 root root 4096 Oct 28 2018 .
drwxr-xr-x 126 root root 12288 Oct 26 02:08 ..
drwxr-xr-x 7 root root 4096 Oct 28 2018 7.0
condor1310:~# find / -name php | grep bin

/usr/lib/cgi-bin/php
/usr/bin/php
/opt/plesk/php/7.3/bin/php
/opt/psa/admin/bin/php
Reply
#6

(10-27-2020, 03:01 AM)zoldos Wrote: /opt/plesk/php/7.3/bin/php

this one should be your php7.3 binary. try executing following command to be sure

Code:
/opt/plesk/php/7.3/bin/php -v

if you got the right result ( php version info ) then you can easily set that as your default command line php using the following command

Code:
sudo update-alternatives --set php /opt/plesk/php/7.3/bin/php

this should do the job.
Reply
#7

I get:

Code:
update-alternatives: error: alternative /opt/plesk/php/7.3/bin/php for php not registered; not setting

Sad
Reply
#8

(This post was last modified: 10-30-2020, 12:41 AM by tgix.)

Just want to chime regarding LTS distros - they are a hassle to run on, been there done that and have the scars to prove it. After I was faced with the same issue when moving from 5.6 to 7.0 on a RedHat LTS hosted by Rackspace and trying to follow the "hacky" way of installing a new PHP on a LTS causing PHP to stop working altogether (forcing me to setup a new server) I have stayed away from LTS releases and instead keep current with PHP using Docker. I know YMMV applies and shared hosting is convenient, but...

Your 16.04 LTS is clearly based on PHP 7.0, but since it is a LTS the maintainers will back-port security fixes (thus the version 7.0.33-0ubuntu0.16.04.7). I guess if you do a

$ php -i | grep Build

I expect you to see a much more recent build date than 2019-01-15 when PHP 7.0 was end of life.
Unfortunately this LTS will stick with PHP 7.0 albeit with back-ports so it's probably as secure as current PHP but not with the features needed for CI4 to run.

Wishing you all the best.
Reply
#9

Hi i had a similar problem on my linux mint system and i installed this package it was missing.

sudo apt-get install php7.4-intl

Just change the php version to yours and give it a shot.

Best.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB