Fatal Error Call To Undefined Function Mysql_connect Php.ini
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 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 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 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 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 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 to work under Apache, although ideally I'd simply prefer to get the existing installation
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 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 you, helping each other. Join them; it only takes a http://stackoverflow.com/questions/15346605/php-apache-php-fatal-error-call-to-undefined-function-mysql-connect 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 10 at 7:19 http://stackoverflow.com/questions/10615436/fatal-error-call-to-undefined-function-mysql-connect 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 comment| up vote 6 down vote Verify
Du siehst YouTube auf Deutsch. Du kannst diese Einstellung unten ändern. Learn more You're viewing YouTube https://www.youtube.com/watch?v=e3y57I63gCw in German. You can change this preference below. Schließen https://bbs.archlinux.org/viewtopic.php?id=152355 Ja, ich möchte sie behalten Rückgängig machen Schließen Dieses Video ist nicht verfügbar. WiedergabelisteWarteschlangeWiedergabelisteWarteschlange Alle entfernenBeenden Wird geladen... Wiedergabeliste Warteschlange __count__/__total__ Fatal error Call to undefined function mysql_connect().avi freehelpvideos AbonnierenAbonniertAbo beenden124124 Wird geladen... fatal error Wird geladen... Wird verarbeitet... Hinzufügen Möchtest du dieses Video später noch einmal ansehen? Wenn du bei YouTube angemeldet bist, kannst du dieses Video zu einer Playlist hinzufügen. Anmelden Teilen Mehr Melden Möchtest du dieses Video melden? Melde dich an, um unangemessene fatal error call Inhalte zu melden. Anmelden Transkript Statistik 60.025 Aufrufe 108 Dieses Video gefällt dir? Melde dich bei YouTube an, damit dein Feedback gezählt wird. Anmelden 109 25 Dieses Video gefällt dir nicht? Melde dich bei YouTube an, damit dein Feedback gezählt wird. Anmelden 26 Wird geladen... Wird geladen... Transkript Das interaktive Transkript konnte nicht geladen werden. Wird geladen... Wird geladen... Die Bewertungsfunktion ist nach Ausleihen des Videos verfügbar. Diese Funktion ist zurzeit nicht verfügbar. Bitte versuche es später erneut. Veröffentlicht am 16.06.2012If you have received the dreaded "Fatal error Call to undefined function mysql_connect()", this video may help.Here is the text from the video:Fatal error: Call to undefined function mysql_connect()php.iniC:\WINDOWSC:\WINDOWS\SYSTEM32extension_dir = "./"extension_dir = "C:\php\ext";extension=php_mysql.dllextension=php_mysql.dll Kategorie Bildung Lizenz Standard-YouTube-Lizenz Mehr anzeigen Weniger anzeigen Wird gela
#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 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 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 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-06 19:53:30 xworld Member Registered: