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

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

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 应用程序出现错误:

类型:错误

信息:调用未定义的函数 mysqli_init()

文件名:/var/www/html/CI_PROJECT/system/database/drivers/mysqli/mysqli_driver.php

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

extension=mysqli
extension=/path/to/extension/mysqli.so
mysqli.allow_local_infile = On

然后执行:

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 :

Type: Error

Message: Call to undefined function mysqli_init()

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):

extension=mysqli 
extension=/path/to/extension/mysqli.so
mysqli.allow_local_infile = On 

Then, did

systemctl restart apache2

Please guide me with appropriate solution.

答案1

得分: 3

尝试这样做:

sudo apt-get install php7.4-mysql

然后,在Router.php文件中:

/var/www/html/CI_PROJECT/application/third_party/MX/Router.php

// if (strpos($class, $suffix) === FALSE)
if ($suffix && strpos($class, $suffix) === FALSE)

在Modules.php文件中:

/var/www/html/CI_PROJECT/vv_project/application/third_party/MX/Modules.php

// (is_array($module)) ? list($module, $params) = each($module) : $params = NULL;	
(is_array($module)) ? list($module, $params) = [key($module), current($module)] : $params = NULL;
英文:

Try This :

sudo apt-get install php7.4-mysql

Then, in Router.php file

/var/www/html/CI_PROJECT/application/third_party/MX/Router.php         

 // if (strpos($class, $suffix) === FALSE)
 if( $suffix && strpos($class, $suffix) === FALSE)

And in Modules.php File

/var/www/html/CI_PROJECT/vv_project/application/third_party/MX/Modules.php

// (is_array($module)) ? list($module, $params) = each($module) : $params = NULL;	
(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:

确定