Fatal Error Call To Undefined Function Mysql_connect Php Ubuntu
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 Users call to undefined function mysql_connect() xampp Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping
Call To Undefined Function Mysql_connect() Linux
each other. Join them; it only takes a minute: Sign up 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 call to undefined function mysql_connect() windows 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 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 call to undefined function mysql_connect() codeigniter 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 vote In my case php5-mysql was missing from my Ubuntu server. After installing the package it is working fine with mysqli adapter. sudo apt-get install php5-mysql It resolved my CodeIgniter 3.0 mysqli connection valid. share|improve this answer edited Feb 25 at 16:50 Peter Mortensen 10.2k1369107 answered Jul 6 '15 at 2:41 syyu 16629 don't forget to restart apache after that sudo service apache2 restart –Waqleh Mar 27 at 10:37 add a comment| Your Answer draft saved draf
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
Call To Undefined Function Mysql_connect() Php 7
Stack Overflow the company Business Learn more about hiring developers or posting ads with call to undefined function mysql_connect() ubuntu us 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_connect() Centos
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 http://stackoverflow.com/questions/24290589/ubuntu-php-fatal-error-call-to-undefined-function-mysqli-connect-in-when-ca 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 nothing seem
communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour 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 http://askubuntu.com/questions/484256/ubuntu-server-14-mysql-php-connect-problem of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Ask Ubuntu Questions Tags Users Badges Unanswered Ask http://www.somacon.com/p109.php Question _ Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a call to question Anybody can answer The best answers are voted up and rise to the top Ubuntu Server 14 MySql php connect problem up vote 0 down vote favorite 1 I have ubuntu server 14.04 installed along side Apache, PHP5 and MySQL server all together. I can gain access to the server using putty and the mysql database using Heidi Sql remotely. On my laptop, call to undefined using xampp to write and read from the database on the server works perfectly fine using PHP, but when the same code on the server is ran nothing happens the code stops at $connect = mysql_connect($host,$user,$pass) or die('Connection error'); After the code is run off the server the page remains blank and does not even show the Connection Error message in the die section. Note: Apache, PHP and MySQL works fines because all my web pages are in PHP. server apache2 mysql php share|improve this question edited Jun 16 '14 at 21:04 Parto 6,577164080 asked Jun 16 '14 at 20:58 user294159 911 Did you change your $host variable to localhost when you run it from the server? To show error messages, add this line before the $connect part: ini_set('display_errors',1);. Run the code again and include any error messages here. –Parto Jun 16 '14 at 21:02 I get the following error after placing that code. Fatal error: Call to undefined function mysql_connect() in /var/www/html/Typit/Login.php on line 24 –user294159 Jun 16 '14 at 21:25 Did you restart apache in the server after installing it?askubuntu.com/questions/6358/how-do-you-restart-apache &nd
through the package manager. After starting the MySQL and Apache services through the service manager, you write a simple test php page to access the MySQL database. When the page is loaded in the web browser, you receive the error, Fatal error: Call to undefined function mysql_connect(). Sample Code Cause The mysql.so extension library does not come with the PHP or MySQL distributions. It must be installed separately by downloading the php-mysql RPM. Fix 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, both of which are beyond the scope of this document. Verify that the line to load the extension in php.ini has been uncommented. In Linux, the line is extension=mysql.so and in Windows, the line is extension=php_mysql.dll. Uncomment the line by removing the semi-colon. You might also need to configure the extension_dir variable. Check if the php-mysql package is installed by opening a terminal window (bash), and typing, rpm-qa|grepphp. If you don't see it, make a note of the exact version of PHP that is installed. Find the php-mysql RPM for the version of PHP that is installed on your system. The easiest way to find it is to search by the version of RedHat you have. Go to a RedHat mirror or look on your RedHat CDs. If you have RedHat 8.0, then navigate to the folder /linux/8.0/en/os/i386/RedHat/RPMS/ and search for php-mysql. Download this file. (For a list of mirror sites, try RedHat Mirrors or search Google for redhat mirrors.) To install the file, open a terminal window and cd to the directory where you saved the RPM. Then type rpm-hivvphp-mysql-4.2.2-17.i386.rpm and press enter. This will install the RPM for RedHat 9.0. You might also need MySQL-shared-compat RPM if you get a dependency of libmysqlclient.so.10 error while installing. T