Fatal Error Call To Undefined Function Mysqli_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 more about Stack Overflow the company Business Learn
Fatal Error Call To Undefined Function Connect
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags sugarcrm call to undefined function mysqli_connect Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, php call to undefined function mysql_connect helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function mysqli_connect() in… while connecting PHP 5.4.22 and MySQL 5.5 with Apache 2.4.7 up vote 4 down vote favorite 3 I
Fatal Error Call To Undefined Function Mysqli Connect Linux
am trying to connect PHP 5.4.22 and MySQL 5.5 with Apache 2.4.7 as the web server. All three of these individually are working fine. However, when I try to connect PHP with MySQL I get the error: "Fatal error: Call to undefined function mysqli_connect() in..." db_connect.php code $con = mysqli_connect("localhost","root","root","mylab_dev"); if (mysqli_connect_errno($con)) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $conn->close(); httpd.conf configuration: ServerRoot "c:/Apache24" #Listen 12.34.56.78:80 Listen 80 LoadModule php5_module "C:/php/php5apache2_4.dll" (Verified the
Fatal Error Call To Undefined Function Mysql Connect
existence of the physical file) AddHandler application/x-httpd-php .php DirectoryIndex index.php index.html PHPIniDir c:/php Modified php.ini-development file to php.ini ; extension_dir = "./" ; On windows: extension_dir = "ext" extension=php_mysql.dll --> Uncommented extension=php_mysqli.dll --> Uncommented Set the date timezone accordingly One thing I noticed but not sure if this is the reason, in the phpinfo() page I see the MySQL information, but I don't see anything which says mysqli(). Should I? php mysql mysqli share|improve this question edited Feb 25 at 8:03 Peter Mortensen 10.2k1369107 asked Mar 1 '14 at 15:46 Souvik 26125 2 Why do you think "the reason is different"? –Your Common Sense Mar 1 '14 at 15:47 4 Try set extension_dir to full path (eg C:\Path\To\PHP\ext) restart your Apache server and run code again. –barell Mar 1 '14 at 15:49 Thanks Barell, it worked! :) This is the height of embarrassment! I have been breaking my head over this few days but it never came to head that this is the reason and so simple! Thanks a ton! –Souvik Mar 1 '14 at 16:04 barell you should make your comment an answer. id vote for it. it totally fixed my problem too :) –bia.migueis Jul 18 '15 at 18:43 add a comment| 5 Answers 5 active oldest votes up vote 2 down vote I had the same error,
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and mysqli connect object oriented policies of this site About Us Learn more about Stack Overflow the
Mysqli Connect Db
company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags mysqli connect access denied for user 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 http://stackoverflow.com/questions/22116491/fatal-error-call-to-undefined-function-mysqli-connect-in-while-connecting takes a minute: Sign up Fatal error: Call to undefined function mysqli_connect() up vote 7 down vote favorite 1 For 2 days now I'm trying to solve this, but unfortunately no result. Let me tell you my story about the problem. I've bulid an application on a site, and the application deals with the reviews. But, I'm trying to put it http://stackoverflow.com/questions/25281467/fatal-error-call-to-undefined-function-mysqli-connect/25281540 on another site, and I copyed the php files, the sql file from the old site, and moved them to the new site (they are on different FTP servers). When I'm trying to go to the pages from the application, I receive this FATAL ERROR: Fatal error: Call to undefined function mysqli_connect() The code that I wrote to connect to the database is this (with hidden credentials): $con = mysqli_connect("","*the_name*","*the_pass*","*the_database*"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } Why do I get the error? It works on the old server, and the code I think it's not the problem, because it works on localhost, and on the new server it doesn't. Can anyone help me? php mysql ftp share|improve this question asked Aug 13 '14 at 8:28 Emi 971210 3 looks line in you server mysqli extension is not enabled. check if mysqli is enabled phpinfo() –bansi Aug 13 '14 at 8:30 1 please enable mysqli extension –Agha Umair Ahmed Aug 13 '14 at 8:55 add a comment| 7 Answers 7 active oldest vote
this problem solved, to no avail. I am new to MySQL (zero experience) https://www.sitepoint.com/community/t/fatal-error-call-to-undefined-function-mysqli-connect/5923 and am studying the book Build your Own Database Driven Website Using PHP & MySQL 4th edition by Sitepoint. I have experience using PHP. Chapters 1 through 3 went fine with no problems. From the mysql command prompt I have created a database, created a table and then added data to the table just call to as the book describes. The PHP files in chapters 1 through 3 also functioned properly. When I attempted to connect to the database using PHP in chapter 4 is where I am experiencing problems. When the mysqli_connect command is executed, I receive the error Fatal error: Call to undefined function mysqli_connect() in D:\wwwtop\MySQL_class\connect\index.php on call to undefined line 4. Here is the code (mostly copied from the book): MySQL version: 5.0.22-community-nt PHP Version: 5.1.4Apache Version: 2.0.58 (Win32) Operating Sys: WIN 7 Pro - 64 bit (Intel Core i7-920 processor(8MB L3 Cache, 2.66GHz) 12 gig RAM)Some of the things I have verified from looking at other posts: >> To prove I am editing the correct php.ini file I have made changes (such as error reporting level) and verified the change was effective. >> In php.ini the line extension=php_mysqli.dll exists and is not commented out. >> My path = %SystemRoot%\\system32;%SystemRoot%;%SystemRoot%\\System32\\Wbem;%SYSTEMROOT%\\System32\\WindowsPowerShell\\v1.0\\;c:\\Program Files (x86)\\Common Files\\Roxio Shared\\10.0\\DLLShared\\;c:\\Program Files (x86)\\Common Files\\Roxio Shared\\DLLShared\\;C:\\Program Files (x86)\\MySQL\\MySQL Server 5.0\\bin;C:\\php\\;C:\\Program Files (x86)\\Common Files\\Adobe\\AGL;C:\\php\\ext >> I have executed the same script using my account with my hosting provider and it functioned properly. I have been running Apache and P