2

I'm new to PHP and trying to open the CodeIgniter 4 welcome page by using localhost (I don't have any server programs like XAMPP since it's a company computer and PHP works fine with its built-in server.)

When I try to run the command: php spark serve on the terminal, it gives an error like this:

Uncaught Error: Call to undefined function CodeIgniter\CLI\mb_strpos() in C:\Users\50290536\Desktop\php-test\system\CLI\CLI.php:776

I enabled the necessary extensions in the php.ini file and the file: php_mbstring.dll is available in the directory php/ext.

I also tried to run the command: php spark to see if spark works fine but in that case, I got the following error:

The framework needs the following extension(s) installed and loaded: curl, intl, mbstring at SYSTEMPATH\Codeigniter.php:224

All these extensions are enabled in the php.ini file and their respective .dll files are available in the directory php/ext.

Details:


PHP version: v8.2

CodeIgniter 4 framework version: v4.2.10

Currently enabled PHP modules after running the command: php -m

bcmath
calendar
Core
ctype
date
dom
filter
hash
iconv
json
libxml
mysqlnd
pcre
PDO
Phar
random
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
steven7mwesigwa
  • 5,701
  • 3
  • 20
  • 34
  • 1
    Please, open your terminal/command prompt, run this command, `php -m` , then [edit your question](https://stackoverflow.com/posts/74813216/edit), and share the output. This command will list all currently enabled modules. – steven7mwesigwa Dec 15 '22 at 19:12
  • 1
    In addition, navigate to the file at the path: `your-project-root-directory-here/system/CodeIgniter.php`. In that file share the class property value corresponding to: `public const CI_VERSION = '...'` This will indicate the current framework version. – steven7mwesigwa Dec 15 '22 at 19:26
  • Thank you, I added CI version and enabled modules. – Elif Ece Sanli Dec 16 '22 at 06:31
  • As shown in the output of currently enabled modules, the modules that CodeIgniter 4 depends on namely: `curl`, `intl`, `mbstring` appear to be **missing**. The closest *culprit* is that you're likely editing the wrong `php.ini` configuration file. – steven7mwesigwa Dec 16 '22 at 08:30
  • What is your current operating system? If you're using *'Windows'*, ensure that you've enabled/uncommented the [directory path in which the loadable extensions (modules) reside](https://github.com/php/php-src/blob/b9cd1cdb4f236b7e336b688b16d58a913f4d5c69/php.ini-production#L774) – steven7mwesigwa Dec 16 '22 at 08:50
  • I also hope that you're editing a configuration file labeled: `php.ini` and *not* `php.ini-development` or `php.ini-production` – steven7mwesigwa Dec 16 '22 at 09:06
  • Well actually there wasn't a php.ini file and someone suggested to copy the php.ini-development file and rename it as php.ini then make the changes. So I did as he said. Did I make a mistake? and yes my operating system is windows. – Elif Ece Sanli Dec 16 '22 at 09:26

0 Answers0