CodeIgniter 4 problem installing with composer
Your PHP is missing intl extension. It is useful for formatting currency, number and date/time as well as UCA-conformant collations, for message formatting and normalizing text..etc.
Check out Codeignitor 4 [Documentation][1]:
Follow the steps to install it in XAMPP -
- Open [xampp_folder_path]/php/php.ini to edit.
- Search for ;extension=intl and remove the ;.
- Save the php.ini file and restart Apache.
Failed while installing a package using composer
I presume you created your project by using composer create-project codeigniter4/framework
. This effectively created a clean project for you without the .git
folder, thus removing any metadata on what version of codeigniter4/framework
package you installed. This is indicative by 1.0.0+no-version-set
part of the error message.
The jason-napolitano/codeigniter4-cart-module
package requires ^4.0.3
version of codeigniter4/framework
, but since you have no version metadata in your project, install fails. This can be resolved by setting the version from which you bootstrapped your project manually in your root composer.json
:
{
"name": "codeigniter4/framework",
"version": "4.0.3",
...
}
However, this is just a guess, since I have no insight into your main composer.json
. How to use a composer package in CodeIgniter 4?
Try this
<?php
namespace App\Controllers;
use App\Controllers\BaseController;
use chillerlan\QRCode\{QROptions, QRCode};
class Qr extends BaseController
{
public function index($path)
{
$data = 'otpauth://totp/test?secret=B3JX4VCVJDVNXNZ5&issuer=chillerlan.net';
echo '<img src="' . (new QRCode)->render($data) . '" alt="QR Code" />';
}
}
Codeigniter 4 composer update PHP Fatal error: Uncaught Error: Call to a member function run() on int in index.php
Codeigniter v4.2.0 changes
index.php
and spark
files have significant changes in v4.2.0.
To upgrade, you must merge the new versions.
If you are using the standard CI4 index.php (you've not modified it):
cd <root-dir-of-CI-project>
cp vendor/codeigniter4/framework/public/index.php public/index.php
And similarly for standard CI4 spark
(you've not modified it):cd <root-dir-of-CI-project>
cp vendor/codeigniter4/framework/spark .
ELSE merge the new versions of index.php
and spark
with your current versions.https://codeigniter4.github.io/userguide/installation/upgrade_420.html#index-php-and-spark
CI4 Getting started issues
Waited a few days for the fix to be released. Did a composer update which moved me from CLI 4.0.1 to 4.0.2 but the problem persisted.
Made a new project and it all worked as expected.
Not sure if the composer update was supposed to work or not but at least the welcome page is now showing.
Related Topics
Imagemagick Brew Installation with PHP Module in MAC Os X
Sort Array Based on the Datetime in PHP
Call to Undefined Function Curl_Init() - with Wamp
Laravel Errno 150 Foreign Key Constraint Is Incorrectly Formed
Are There Any PHP Docblock Parser Tools Available
How to Tag a User in a Photo Using the Facebook Graph API
Upload File Using Guzzle 6 to API Endpoint
Bool Parameter from Jquery Ajax Received as Literal String "False"/"True" in PHP
Using PHP & Curl to Login to My Websites Form
Create a Zip File Using PHP Class Ziparchive Without Writing the File to Disk
How to Convert Ldap Timestamp to Unix Timestamp
Check and Return Duplicates Array PHP
How to Convert Latin1_Swedish_Ci Data into Utf8_General_Ci
When Should I Close a Database Connection in PHP
How to Add Item to the JSON File Formatted Array