0

I had a old project which is created in CodeIgniter 4 and was working in my old system now I have taken the copy of the project and trying to run the same. But its giving me below error

CodeIgniter v4.1.4 Command Line Tool - Server Time: 2022-04-13 06:16:27 UTC-05:00

[ErrorException]

Constant FILTER_SANITIZE_STRING is deprecated

at SYSTEMPATH\HTTP\CLIRequest.php:175

Backtrace: 1 SYSTEMPATH\HTTP\CLIRequest.php:175 CodeIgniter\Debug\Exceptions()->errorHandler(8192, 'Constant FILTER_SANITIZE_STRING is deprecated', 'C:\xampp\htdocs\hylasto-api\system\HTTP\CLIRequest.php', 175)

2 SYSTEMPATH\HTTP\CLIRequest.php:67 CodeIgniter\HTTP\CLIRequest()->parseCommand()

3 SYSTEMPATH\Config\Services.php:123 CodeIgniter\HTTP\CLIRequest()->__construct(Object(Config\App))

4 SYSTEMPATH\Config\BaseService.php:248 CodeIgniter\Config\Services::clirequest(Object(Config\App), false)

5 SYSTEMPATH\Config\BaseService.php:189 CodeIgniter\Config\BaseService::__callStatic('clirequest', [...])

6 SYSTEMPATH\Config\Services.php:118 CodeIgniter\Config\BaseService::getSharedInstance('clirequest', Object(Config\App))

7 SYSTEMPATH\Config\BaseService.php:248 CodeIgniter\Config\Services::clirequest(Object(Config\App))

8 SYSTEMPATH\CodeIgniter.php:527 CodeIgniter\Config\BaseService::__callStatic('clirequest', [...])

9 SYSTEMPATH\CodeIgniter.php:292 CodeIgniter\CodeIgniter()->getRequestObject()

10 SYSTEMPATH\CLI\Console.php:48 CodeIgniter\CodeIgniter()->run()

11 ROOTPATH\spark:63 CodeIgniter\CLI\Console()->run()

Can anyone help me with this.

  • Probably the PHP versions of two host machines are not same. In the command line, you can check it by typing `php -v`. Happy coding.. – YahyaE Apr 16 '22 at 07:28
  • thank for the reply.. i don't have the old system as its dead.. and the new system is running php version 8.1.4 – Sajeed Shaikh Apr 16 '22 at 10:39
  • `Deprecated as of PHP 8.1.0, use htmlspecialchars() instead.`. Either you need to update CI version or you need to downgrade PHP version to lower then 8.1.0 - to PHP 7.4 I presume. – YahyaE Apr 17 '22 at 17:36

0 Answers0