Fatal Error Call To Undefined Function Mysql_connect Ubuntu Server
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 call to undefined function mysql_connect() in php this site About Us Learn more about Stack Overflow the company Business Learn
Call To Undefined Function Mysql_connect() Xampp
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question call to undefined function mysql_connect() linux 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 takes a minute: Sign up
Call To Undefined Function Mysql_connect() Windows
Ubuntu PHP Fatal error: Call to undefined function mysqli_connect() in.. when calling PHP script up vote 1 down vote favorite I run Ubuntu desktop 14.04 LTS (Trusty Tahr), and I am trying to setup Apache 2, MySQL server and PHP, but I keep gettin the following error: PHP Fatal error: Call to undefined function mysqli_connect() in.. What I have done is these changes in call to undefined function mysql_connect() codeigniter the correct php.ini: uncomment: extension=msqli.so set path aquired from phpinfo(): extension_dir = "./usr/lib/php5/20121212+lfs" Why is the mysqli function to connect to the database still undefined? php apache mysqli share|improve this question edited Feb 25 at 16:50 Peter Mortensen 10.2k1369107 asked Jun 18 '14 at 16:22 jt123 4671729 3 I suspect you don't have php_mysql package installed. Run this on the command line: dpkg --get-selections |grep php5-mysql and see whether it reports install as the status. –Aleks G Jun 18 '14 at 16:24 1 I'm not sure how the Debian packages differ in names vs CentOS, but do you have php-mysql or php-mysqlnd installed? The latter would be preferred –Machavity Jun 18 '14 at 16:24 2 msqli.so is not a valid extension filename. it should be mysqli.so –Marc B Jun 18 '14 at 16:29 3 sudo apt-get install php5-mysql --- will install it and after you need add extension=mysqli.so in /etc/php5/apache2/php.ini –Tasos Jun 18 '14 at 16:37 Thanks @Tasos. Working here as well. –Tpojka Jun 3 '15 at 21:55 add a comment| 1 Answer 1 active oldest votes up vote 4 down
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
Ubuntu Call To Undefined Function Mysql_connect()
Stack Overflow the company Business Learn more about hiring developers or posting ads with
Call To Undefined Function Mysql_connect() Centos
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is call to undefined function mysql_connect() php 7 a community of 4.7 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 vote 18 down vote http://stackoverflow.com/questions/24290589/ubuntu-php-fatal-error-call-to-undefined-function-mysqli-connect-in-when-ca 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 error log). PHP works okay on its http://stackoverflow.com/questions/15346605/php-apache-php-fatal-error-call-to-undefined-function-mysql-connect 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 for months to solve this problem, and seem to have tried everything, but noth
#1 2012-11-06 02:24:52 xworld Member Registered: 2012-05-27 Posts: 153 [SOLVED]Call to undefined function mysql_connect() Hi. Up until this point I have had mysql, php, and apache https://bbs.archlinux.org/viewtopic.php?id=152355 up and running just fine. Recently I made a little change. I configured Apache to read my .php pages from /home/user/code/php instead of /srv/http. It wasn't working originally so I created a new http user using this command:useradd -d /srv/http -r -s /bin/false -U httpAnd replaced /srv/http with the directory of my choice. Almost everything call to went fine. I was able to see all my .php files. The problem was with one file. This is the code for it:"; ?>Originally it displayed everything fine but once I made the switch it displayed this error: Fatal error: Call to undefined function call to undefined mysql_connect() in /home/'user'/code/php/connect.php on line 2I tried to login to phpMyAdmin as well and this error is displayed:The mysqli extension is missing. Please check your PHP configuration. Not sure if it matters but I have made the switch to a systemd only installation and have run systemctl enable httpd.service, systemctl enable mysqld.service, systemctl start httpd.service, and systemctl start mysql.service countless times just to be sure. I have also made sure thatextension=mysqli.so extension=mysql.soAre both uncommented in /etc/php/php.ini Last edited by xworld (2012-11-08 00:48:14) Offline #2 2012-11-06 13:45:51 yaffare Member Registered: 2011-12-29 Posts: 71 Re: [SOLVED]Call to undefined function mysql_connect() please run phpinfo(); and post that. The mysql.so module is definitely not loaded. Do you have extension_dir = "/usr/lib/php/modules/" in php.ini? Does the file /usr/lib/php/modules/mysql.so exist?If so apache must be using a different php.ini than /etc/php/php.ini. You can see that in phpinfo. (Loaded Configuration File) systemd is like pacman. enjoys eating up stuff. Offline #3 2012-11