![]() |
OK, here we go again: installing using composer? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: OK, here we go again: installing using composer? (/showthread.php?tid=77453) |
OK, here we go again: installing using composer? - blaasvaer - 09-03-2020 I'm starting all over from scratch with CI4 to get my head around it – as it seems trying to do things the way you used to in CI3 is not going to cut it – in ANY way. And we start off just fine by being kicked in the balls when just trying to install the bugger; using composer. If I run: Code: $ composer create-project codeitniter4/appstarter CI4 I get this: Code: Could not open input file: /usr/local/bin/composer.phar I then try to figure out what could possibly be wrong with composer by doing this: Code: $ composer --version I then get: Code: -bash: /usr/local/bin/composer.phar: No such file or directory I then try this: Code: $ which composer and get this: Code: /usr/local/bin/composer So, what did I miss in the process of just getting started? Oh boy, it's a long way to home. So, it turned out that the composer symlink in '/usr/bin/local' didn't have the .phar extension which 'something' obviously asks for when running the '$ composer' command. Adding it made SOME progress. Now, I'm facing this issue: Code: $ composer create-project codeigniter4/appstarter CI4 So, I guess I'm having some issue with what 'php' I'm actually using ... I've got MAMP installed, so I could potentially have some issue here. Let's move on, shall we? Running this: Code: $ php --version return this: Code: PHP 7.3.11 (cli) (built: Jul 5 2020 03:23:39) ( NTS ) And I can see in my MAMP settings, that the version allegedly running there is 7.4.2 ... so. The task here is; to make composer, codeigniter 4 and all other crap that needs php to run point to the right version of php, I guess. OK, let's try to do that then, shall we? So, after a nice session over at stackoverflow.com I ended up doing this, added the following to my .bash_profile (yes, I know I'm supposed to be running zsh, but there's only so much 'crap' one can take on a one time): PHP Code: export PATH="/Applications/MAMP/bin/php/php7.4.2/bin:${PATH}"; So, apart from getting another bone thrown to fetch: Code: Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested. Thanks for letting me know, by the way, the installation ran smoothly(!). Now, on to actually do something in CI4. Phew. To be continued … RE: OK, here we go again: installing using composer? - InsiteFX - 09-03-2020 the requested PHP extension intl is missing from your system. You need to remove the ; (semi-colon) form the extension in the php.ini file. RE: OK, here we go again: installing using composer? - blaasvaer - 09-03-2020 Maybe, but I chose to point to the right PHP version instead ... RE: OK, here we go again: installing using composer? - captain-sensible - 09-04-2020 i don't know if this is superfluous but the way i use composer on LINUX is to download composer.phar then I : Code: # chmod 777 composer.phar that means that the use of composer.phar is now used linked to "composer" by quoting just composer and its now accessible to use as normal user not root eg $ composer update --no-dev Also looking at your post it says Created project in /usr/local/bin/CI4 i haven't read all the posts above through obviously being a slackware user ( i'm a lazy slacker) but i think you alluded thats not a good place . As i have shown above by making it permission 777 and in /usr/local...you can invoke composer and "$" normal user. For anything , if i understood your post correctly, by the fact it started stuff in /usr/local i'm guessing you were running composer as "root" which is not necessary. The appstarter is a good choice i find then i only get one copy of CI4 all within vendor. RE: OK, here we go again: installing using composer? - InsiteFX - 09-04-2020 I'm on Windows 10 Pro x64 and I installed Composer global works like a charm here. RE: OK, here we go again: installing using composer? - captain-sensible - 09-05-2020 (09-04-2020, 08:23 AM)InsiteFX Wrote: I'm on Windows 10 Pro x64 and I installed Composer global works like a charm here.there are quirks with Linux; i have no problem with composer but since we mentioned it and the O.P is obviously on linux here is another quirk : You are developing a CI4 " appstarter" website in apache of your Linux box so your path to web is say /var/www/htdocs/CI4.0.4 "you" as in me or anyone like's appstarter since the directory system is neat and when you want anything such as bootstrap IV using composer eg : composer require twbs/bootstrap it gets put in "vendor" here is the problem /var/www/htdocs is not accessible to a "normal" user because its considered part of the Linux system path (just like /opt is for xampp) you have a composer.json file in /var/www/htdocs/CI4.0.4 can't run it as normal user and its not a good idea to run as "root" since strange things can happen and you could mess up your system. The answer is to look at who owns "apache" in terms of permissions and add yourself to the group of who owns "apache" and then Code: # chmod 775 /var/www/htdocs/CI4.0.4 -R that will allow you to run composer in /var/www/htdocs/CI4.0.4 with normal user permissions( and have not found it messes up runing apche for dev so far. by Code: cd /var/www/htdocs/CI4.0.4 |