简体   繁体   English

致命错误:调用未定义函数mysql_connect()

[英]Fatal error: Call to undefined function mysql_connect()

i changed my hosting from bigrock to google cloud. 我将托管从bigrock更改为Google Cloud。 previously my code was working good without any single error when it is in bigrock php version 5.4.45, but now when i shifted to google cloud the version is about 5.6 and my code used to show many errors later i changed the php version of my google cloud server to 5.4.45 same as bigrock, even now i am getting this 以前,我的代码在bigrock php版本5.4.45中运行良好,没有任何错误,但是现在当我转移到google cloud时,该版本约为5.6,而我的代码过去常常显示很多错误,后来我更改了php版本谷歌云服务器与bigrock相同至5.4.45,即使现在我正在这个

Fatal error: Call to undefined function mysql_connect(). 致命错误:调用未定义函数mysql_connect()。

i don't understand why this code shows errors in google cloud with same php version when it is working good at bigrock hosting. 我不明白为什么这段代码在bigrock托管时效果很好,为什么在同一版本的php版本中会在Google云中显示错误。

The mysql_* based functions were deprecated with PHP 5.5.x . PHP 5.5.x 不推荐使用基于mysql_ *的函数。

Even though you may have "rolled back" the version, it is likely that the old mysql libraries are not available/present on the cloud. 即使您可能已经“回滚”了该版本,但旧的mysql库很可能在云中也不可用。 Consider updating to the mysqli -based functions (which is not too difficult a transition, but there are differences) or use PDO. 考虑更新到基于mysqli的函数(过渡不是很困难,但是有所不同)或使用PDO。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM