Fatal Error Call To Undefined Function Mysql_connect In Linux Php
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 call to undefined function mysql_connect() in php more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags 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, call to undefined function mysql_connect() windows helping each other. Join them; it only takes a minute: Sign up PHP/Apache: PHP Fatal error: Call to undefined function mysql_connect() up vote 18 down vote favorite 2 I have MySQL (5.5.23 Community Server), Apache (2.2), and PHP call to undefined function mysql_connect() codeigniter (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 error log). PHP works okay on its own though, through Apache and at the command line. When I run php -i from the command
Call To Undefined Function Mysql_connect() Linux
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 for months to solve this problem, and seem to have tried everything, but nothing seems to work. I don't mind having to re-install PHP if I really have to, if somebody can demonstrate the proper way to configure/compile with MySQL support, so that I can get it t
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
Call To Undefined Function Mysql_connect() Php 7
Learn more about Stack Overflow the company Business Learn more about hiring developers call to undefined function mysql_connect() centos or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack call to undefined function mysql_connect() ubuntu Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Linux PHP Fatal error: Call to undefined http://stackoverflow.com/questions/15346605/php-apache-php-fatal-error-call-to-undefined-function-mysql-connect function mysqli_connect() up vote 4 down vote favorite 1 I have a problem regarding connecting the database it is giving this error Fatal error: Call to undefined function mysqli_connect() Which, I have spend the past 4 hours trying to figured out and I already did these steps: Change extension=mysql.so and extension=mysqli.so extension_dir=/PATH for php.ini Checked which modules are loaded or install with php - m I JUST http://stackoverflow.com/questions/19719719/linux-php-fatal-error-call-to-undefined-function-mysqli-connect PUT MY INFOPHP() IN PASTEBIN SORRY, MY WEBSITE IS RUNNING UNDER USERNAME AND PASSWORD PROTECTING BECAUSE IS A PRIVATE UNIVERSITY SERVER.. http://pastebin.com/dKKdwWTb I am not too sure what else I can do about, just in case I have added the link for paste bin for my php.ini file http://pastebin.com/QNK6mGqV Well, I hope someone could see what I have been able to see and could help me out. php mysql apache mysqli share|improve this question edited Oct 7 '14 at 1:53 Timothy Jones 13.2k23259 asked Nov 1 '13 at 2:05 valbu17 35117 What if you were to post your actual code that's producing the error *?* –Fred -ii- Nov 1 '13 at 2:10 Fred, this type of error does not really require code example. –Itay Moav -Malimovka Nov 1 '13 at 2:13 @ItayMoav-Malimovka Ok, I thought I could help, seeing the subject line Call to undefined function mysqli_connect() –Fred -ii- Nov 1 '13 at 2:15 yah, its not error code.. its actually some problem with the apache server or mysql installation.. or something regarding not having the right path to get php.ini or some modules.. –valbu17 Nov 1 '13 at 2:
#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 mysql_connect php script and it ran fine, no errors, but https://bbs.archlinux.org/viewtopic.php?id=138131 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 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: 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 call to undefined 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 error: Call to undefined function mysql_connect() error. astiak wrote:Your php code is absolutely fine.Do you have the mysql modules showing up in the output of "php -m"?This is what it prints outPHP: syntax error, unexpected '&' in /etc/php/php.ini on line 510 [PHP Modules] Core ctype date dom ereg fileinfo filter hash libxml mbstring mhash mysqlnd pcntl pcre PDO