Php 5 Fatal Error Call To Undefined Function Mysql_connect
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn call to undefined function mysql_connect() windows more about Stack Overflow the company Business Learn more about hiring developers or posting call to undefined function mysql_pconnect ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community call to undefined function mysql_connect() xampp Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up PHP/Apache: PHP Fatal error: Call to undefined function mysql_connect() up
Call To Undefined Function Mysql_connect() Codeigniter
vote 19 down vote favorite 2 I have MySQL (5.5.23 Community Server), Apache (2.2), and PHP (5.3.13) running on a Fedora 15 machine (64-bit). Each works with no problem on their own. I thought that PHP was configured/compiled to work with MySQL, but when I try to load any PHP web page which makes a MySQL call then I get the above noted fatal error (in the Apache call to undefined function mysql_connect() php 7 error log). PHP works okay on its own though, through Apache and at the command line. When I run php -i from the command line then sure enough it shows all the MySQL bits and pieces, but when I load a page displaying phpinfo() then there are no MySQL modules mentioned. I've also tried un-commenting "extension=mysql.so" in php.ini, but PHP then complains with "PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/mysql.so'." (even though the module does reside there). But then I'm not entirely certain whether that line is required to be un-commented or not. [correction: the error stated was actually due to a typo, but running from the command line shows that the module is already loaded anyway - there is a warning from PHP that says so.] I've also disabled SELinux; stopped/restarted Apache numerous times; yummed MySQL-Devel, in case it made any difference; and, it seems, every other possible thing. If I run a little PHP test script from the command line, to access the MySQL database, then it works with no problem, so PHP does know about MySQL, but when it runs under Apache it seems to have no clue that MySQL even exists. I've been trying on and off fo
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack call to undefined function mysql_connect() ubuntu Overflow the company Business Learn more about hiring developers or posting ads with us
Call To Undefined Function Mysql_connect() Linux
Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a
Call To Undefined Function Mysql_select_db()
community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function mysql_connect() up vote 21 down vote favorite 6 I http://stackoverflow.com/questions/15346605/php-apache-php-fatal-error-call-to-undefined-function-mysql-connect 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 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 http://stackoverflow.com/questions/10615436/fatal-error-call-to-undefined-function-mysql-connect 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 6 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,06712430 add a comment| up vote 6 down vote Verify that your installation of PHP has been compiled with mysql support. Create a test web page containing and load it in your browser. Search the page for MySQL. If you don't see it, you need to recompile PHP with MySQL support, or reinstall a PHP package that has it built-in share|imp
using php5.2,mysql 4.1 If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register http://board.phpbuilder.com/showthread.php?10371200-RESOLVED-i-am-Fatal-error-Call-to-undefined-function-mysql_connect()-using-php5-2-mysql-4-1 link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Page 1 of 2 12 Last Jump to page: Results 1 to 15 of 21 Thread: http://serverfault.com/questions/379430/php-fatal-error-call-to-undefined-function-mysql-pconnect-in [RESOLVED] i am Fatal error: Call to undefined function mysql_connect() using php5.2,mysql 4.1 Tweet Thread Tools Show Printable Version Email this Page… Subscribe to this Thread… Search Thread Advanced Search Display Linear Mode Switch call to to Hybrid Mode Switch to Threaded Mode 02-08-2010,10:06 AM #1 thread_PHP View Profile View Forum Posts Senior Member Join Date Jan 2006 Posts 323 [RESOLVED] i am Fatal error: Call to undefined function mysql_connect() using php5.2,mysql 4.1 hi all i am getting following error while i am using php 5.2.12 and mysql4.1 in windows Fatal error: Call to undefined function mysql_connect() please help me to solve my problem thanks in advance call to undefined "Speak your truth quietly and clearly, and listen to others, even the dull and ignorant, they too have their story. " Reply With Quote 02-08-2010,10:25 AM #2 halojoy View Profile View Forum Posts Visit Homepage phpMaster Join Date Jun 2005 Location Europe Posts 2,992 Run a phpinfo() to see if the php_mysql extension module is loaded. If it is not, you should activate mysql extension. For example in php.ini: extension=php_mysql.dll PHP Code:
Apache2.4.18 (Win64) / PHP5.6.19 / MySQL5.7.11 / phpMyAdmin4.6.0 Reply With Quote 02-08-2010,02:23 PM #3 bradgrafelman View Profile View Forum Posts Visit Homepage Pna lbh ernq guvf¿ Join Date Jul 2004 Location Kansas City area Posts 19,435 Moved to Install forum. If enabling the "extesion=" line in your php.ini file doesn't work, read over the FAQ stickied at the top of this forum (specifically, the post entitled "2. PHP5 :: Can't use mysql_*() functions"). If neither of those solves your problem, let us know. Reply With Quote 02-10-2010,05:03 AM #4 thread_PHP View Profile View Forum Posts Senior Member Join Date Jan 2006 Posts 323 hi halojoy i am sending you following files containing my phpinfo files Attached Images 3.jpg (92.2 KB,
phpinfo();
?>
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top PHP Fatal error: Call to undefined function mysql_pconnect() in up vote 0 down vote favorite I have updated my php version from php 5.0 to 5.3 and it started showing me this error PHP Fatal error: Call to undefined function mysql_pconnect() in I need your help guyz please suggest me what to do. I have also uncomment extension=mysql.so in my php ini file in php.ini I am using Linux php mysql linux share|improve this question asked Apr 14 '12 at 10:55 Huzoor Bux 103115 migrated from stackoverflow.com Apr 14 '12 at 11:58 This question came from our site for professional and enthusiast programmers. 1 What does your phpinfo() return? Does it include info about MySQL? Server restarted? –cfedermann Apr 14 '12 at 10:58 my PHP says '--without-mysql' i have restarted my server –Huzoor Bux Apr 14 '12 at 11:16 add a comment| 4 Answers 4 active oldest votes up vote 2 down vote accepted Recommendation I would recommend you use mysqli ( http://php.net/manual/en/book.mysqli.php ) which is an improved version of mysql Quick Fix Full Details of all possible reason available at http://www.somacon.com/p109.php Let me know if you need more assitance Last Resort Re install PHP53 Remove the 5.1.x PHP Packages: yum remove php php-* Remove the 5.3.x PHP Packages: yum remove php php53-* Install PHP5.3 yum install php53-cli yum install php53-common yum install php53-devel (If you need development support) yum install php53-gd yum install php53-mbstring yum install php53-mysql yum install php53-soap yum install php53-xml yum install php53-xmlrpc yum install php53-bcmath yum install php53-snmp Restart Apache Service httpd restart yum search share|improve this answer answered Apr 14 '12 at 11:01 Baba 1362 I am using centos its about redhat and i have check all steps given on somacon but didn't got sucess :( –Huzoor Bux Apr 14 '12 at 11:19 Ok .. i'll update my answer for a