升级到 PHP 7.4.1 在 Ubuntu CI 应用中出现错误。为什么?

huangapple go评论96阅读模式
英文:

Upgrade to PHP 7.4.1 in Ubuntu CI Appication throwing Error. Why?

问题

刚升级到 PHP 7.4.1
按照以下链接操作:https://dev.to/pushkaranand/upgrading-to-php-7-4-26dg

升级后,

CodeIgniter 应用程序出现错误:

  1. 类型:错误
  2. 信息:调用未定义的函数 mysqli_init()
  3. 文件名:/var/www/html/CI_PROJECT/system/database/drivers/mysqli/mysqli_driver.php

尝试:取消 php.ini (/etc/php/7.4/apache2/php.ini) 中以下行的注释:

  1. extension=mysqli
  2. extension=/path/to/extension/mysqli.so
  3. mysqli.allow_local_infile = On

然后执行:

  1. systemctl restart apache2

请为我提供适当的解决方案。

英文:

Just upgraded to PHP 7.4.1
followed by : https://dev.to/pushkaranand/upgrading-to-php-7-4-26dg

After upgrade,

Code-igniter application throwing error like :

  1. Type: Error
  2. Message: Call to undefined function mysqli_init()
  3. Filename: /var/www/html/CI_PROJECT/system/database/drivers/mysqli/mysqli_driver.php

Tried : By uncommentating below line in php.ini (/etc/php/7.4/apache2/php.ini):

  1. extension=mysqli
  2. extension=/path/to/extension/mysqli.so
  3. mysqli.allow_local_infile = On

Then, did

  1. systemctl restart apache2

Please guide me with appropriate solution.

答案1

得分: 3

尝试这样做:

  1. sudo apt-get install php7.4-mysql

然后,在Router.php文件中:

  1. /var/www/html/CI_PROJECT/application/third_party/MX/Router.php
  2. // if (strpos($class, $suffix) === FALSE)
  3. if ($suffix && strpos($class, $suffix) === FALSE)

在Modules.php文件中:

  1. /var/www/html/CI_PROJECT/vv_project/application/third_party/MX/Modules.php
  2. // (is_array($module)) ? list($module, $params) = each($module) : $params = NULL;
  3. (is_array($module)) ? list($module, $params) = [key($module), current($module)] : $params = NULL;
英文:

Try This :

  1. sudo apt-get install php7.4-mysql

Then, in Router.php file

  1. /var/www/html/CI_PROJECT/application/third_party/MX/Router.php
  2. // if (strpos($class, $suffix) === FALSE)
  3. if( $suffix && strpos($class, $suffix) === FALSE)

And in Modules.php File

  1. /var/www/html/CI_PROJECT/vv_project/application/third_party/MX/Modules.php
  2. // (is_array($module)) ? list($module, $params) = each($module) : $params = NULL;
  3. (is_array($module)) ? list($module, $params) = [key($module), current($module)] : $params = NULL;

huangapple
  • 本文由 发表于 2020年1月3日 19:21:50
  • 转载请务必保留本文链接:https://go.coder-hub.com/59577716.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定