Fatal Error Call To Undefined Function Mysql_connect In Linux
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and call to undefined function mysql_connect() windows policies of this site About Us Learn more about Stack Overflow the call to undefined function mysql_pconnect company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags
Fatal Error Call To Undefined Function Mysql_connect() Xampp
Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only
Call To Undefined Function Mysql_connect() Codeigniter
takes a minute: Sign up Fatal error: Call to undefined function mysql_connect() up vote 21 down vote favorite 6 I have set up PHP, MySQL, and Apache. localhost() for PHP and it is working well. But after I downloaded MySQL, it reports: Fatal error: Call to undefined function mysql_connect() How can I fix this? php mysql share|improve this question edited Jun call to undefined function mysql_connect() ubuntu 10 at 7:19 Tirthraj Barot 1,3092622 asked May 16 '12 at 9:16 pepsicode 1472310 Did you restart apache after you installed the packages? –Devator May 16 '12 at 9:17 nz.php.net/manual/en/mysql.installation.php –zerkms May 16 '12 at 9:17 1 You tagged your question [mysql-error-1064] - how do you get that if your script can't communicate with MySQL? –Repox May 16 '12 at 9:20 5 If mysqli or PDO works then you're better off using them instead anyway. –GordonM May 16 '12 at 9:21 6 @GordonM is quite right. The mysql_* functions are deprecated. There are better alternatives that support parameterized queries. –pilcrow Jul 7 '12 at 14:03 | show 1 more comment 10 Answers 10 active oldest votes up vote 22 down vote Open your terminal and run bellow command. sudo apt-get install mysql-server If you are running PHP you will also need to install the php module for mysql 5: sudo apt-get install php5-mysql share|improve this answer edited Sep 13 at 7:11 answered Feb 14 '13 at 12:19 Nanhe Kumar 5,05712430 add a com
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta
Call To Undefined Function Mysql_connect() Php 7
Discuss the workings and policies of this site About Us Learn call to undefined function mysql_select_db() more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us call to undefined function mysql_query() Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like http://stackoverflow.com/questions/10615436/fatal-error-call-to-undefined-function-mysql-connect you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function mysql_connect() error up vote 0 down vote favorite I am using Red Hat Enterprise Linux Server release 6.5 (Santiago) I faced the below mentioned error: Fatal error: Call to undefined function mysql_connect() in /var/www-live/muthoot/include/load_config.php on line 10 How http://stackoverflow.com/questions/22837582/fatal-error-call-to-undefined-function-mysql-connect-error can I fix this ? php mysql share|improve this question edited Apr 3 '14 at 16:59 Fred -ii- 69.4k93973 asked Apr 3 '14 at 12:19 Mian Anjum 991113 possible duplicate of Undefined function mysql_connect() error –kba Apr 3 '14 at 12:21 And on top of that: the mysql_* functions have been deprecated for a long time. You should either use the mysqli_* functions or PDO. –kba Apr 3 '14 at 12:22 add a comment| 2 Answers 2 active oldest votes up vote 1 down vote The problem is most likely caused by MySQL module being disabled in PHP. As mysql module is deprecated you should use mysqli or PDO, I would suggest using mysqli_connect() instead. To do that, make sure you have php-pdo and php-mysqli packages installed and make sure that php.ini contains this (for PDO): extension=pdo.so extension=pdo_mysql.so extension=pdo_sqlite.so Or this (for mysqli): extension=mysqli.so share|improve this answer answered Apr 3 '14 at 12:20 phoops 2,09641230 i just move my application to n
#1 2012-03-22 04:31:04 clandest Member Registered: 2012-03-16 Posts: 22 getting Fatal error: Call to undefined function mysql_connect() error. ok, so before I had my https://bbs.archlinux.org/viewtopic.php?id=138131 mysql_connect php script and it ran fine, no errors, but once I changed my php.ini file to give ERROR_REPORTING E_ALL I now get Fatal error: Call to undefined function mysql_connect(). I am just wondering how I can fix this?I followed the arch linux LAMP wiki and I can't figure out why I am getting call to this error after turnning on error_reporting. Thanksthis is my php code Last edited by clandest (2012-03-22 04:36:43) Offline #2 2012-03-22 04:45:24 astiak Member From: call to undefined London, UK Registered: 2010-12-14 Posts: 13 Re: getting Fatal error: Call to undefined function mysql_connect() error. Can you verify whether the following two lines in your php.ini have been uncommented?;extension=mysqli.so ;extension=mysql.soIf not, uncomment both, restart apache and it should resolve your issue. Offline #3 2012-03-22 16:21:48 clandest Member Registered: 2012-03-16 Posts: 22 Re: getting Fatal error: Call to undefined function mysql_connect() error. astiak wrote:Can you verify whether the following two lines in your php.ini have been uncommented?;extension=mysqli.so ;extension=mysql.soIf not, uncomment both, restart apache and it should resolve your issue.yes, both of those were uncommented. I made sure to check that when the problem occurred. Thanks Offline #4 2012-03-22 17:50:56 astiak Member From: London, UK Registered: 2010-12-14 Posts: 13 Re: getting Fatal error: Call to undefined function mysql_connect() error. Your php code is absolutely fine.Do you have the mysql modules showing up in the output of "php -m"? Offline #5 2012-03-22 17:52:19 clandest Member Registered: 2012-03-16 Posts: 22 Re: getting Fatal e