Cakephp Fatal Error Call To Undefined Function Mysql_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 fatal error call to undefined function mysql_connect() xampp About Us Learn more about Stack Overflow the company Business Learn more about
Fatal Error Call To Undefined Function Mysql_connect() Windows
hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join fatal error uncaught error call to undefined function mysql_connect() xampp 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:
Fatal Error Call To Undefined Function Mysql_connect() In Php
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 call to undefined function mysql_connect() codeigniter 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 un
through the package manager. After starting the MySQL and Apache services through the service manager, you write a simple test
Call To Undefined Function Mysql_query() In Php
php page to access the MySQL database. When the page is loaded
Fatal Error: Call To Undefined Function Mysql_select_db()
in the web browser, you receive the error, Fatal error: Call to undefined function mysql_connect(). Sample Code call to undefined function mysql_connect() ubuntu Cause The mysql.so extension library does not come http://stackoverflow.com/questions/15346605/php-apache-php-fatal-error-call-to-undefined-function-mysql-connect 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 http://www.somacon.com/p109.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 redh
Member Hi, I'm currently in the process of trying to install a script onto my server (which I have installed and setup) but whenever I try and setup this script, I https://www.howtoforge.com/community/threads/call-to-undefined-function-mysql_connect-help.7756/ get: Fatal error: Call to undefined function mysql_connect() in /var/www/status/config.php on line 31 I edited my php.ini and uncommented "extension=mysql.so", then restarted Apache but it still doesn't work. I'm currently using Webmin to administrate my http://forums.mysql.com/read.php?52,69846,249204 server. I heard somewehre about needing the line "--with-mysql" but I don't know what this means. My PHPInfo file: http://www.dannyg.co.uk/info.php Any help would be very very much appreciated, Thanks in advance, Daniel. dannyg, call to Oct 28, 2006 #1 till Super Moderator Staff Member ISPConfig Developer MySQL is not enabled in your PHP. Did you install the php-mysql pacakge from your linux distribution? Which php.ini did you edit? till, Oct 28, 2006 #2 dannyg New Member I did "apt-get install php5" and I installed MySQL via Webmin. The PHP works fine (hence the info.php page). Thats all I have installed as far as call to undefined PHP and MySQL goes. I edited the file in "/etc/php5/apache2/php.ini" Thanks, Daniel. Last edited: Oct 28, 2006 dannyg, Oct 28, 2006 #3 falko Super Moderator ISPConfig Developer I cannot access http://www.dannyg.co.uk/info.php ... Does your PHP info page show that MySQL is enabled? Did you install the php5-mysql package? falko, Oct 29, 2006 #4 sysconfig New Member Yes, you are correct you could able to see the MySQL section in phpinfo page , you should have compatible php-mysql client also as suggest by other expert here. However, sometime I have faced this issues after upgrading mysql I suggest you Put this into your my.ini file under the [MYSQLD] section: old_password=1 and restart your mysql service and check. Thanks, sysconfig, Nov 3, 2006 #5 fmosse New Member Hi! I have the same problem. I am getting these message: "Fatal error: Call to undefined function: mysql_connect() in /var/www/html/php/news/news/config.php on line 4" The server has webmin 1.500 installed. This is my phpinfo data: PHP Logo PHP Version 4.3.9 System Linux mail.nocuts.com.ar 2.6.9-42.EL #1 Sat Aug 12 09:17:58 CDT 2006 i686 Build Date Jul 12 2006 13:43:33 Configure Command './configure' '--build=i686-redhat-linux-gnu' '--host=i686-redhat-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.
Community Podcasts MySQL.com Downloads Documentation Section Menu: MySQL Forums :: PHP :: Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\practice\testsql.php on line 17 New Topic Advanced Search Re: Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\practice\testsql.php on line 17 Posted by: hoang nguyen () Date: February 22, 2009 06:06PM This week I started to learn CakePHP. When I use Cake console and I got the same error people have here Fatal error: Call to undefined function mysql_connect() I used Apache2triad and XAMPP ver 1.6 on windows XP 64 bits. On my machine I have many PHP and MySQL projects running. But when I use commandline it showed error Fatal error: Call to undefined function mysql_connect() I thought I XAMPP 1.6 have problem when they compile PHP and MySQL. I download new XAMPP 1.7 and set up on own machine running windows xp and it worked fine. But on this machine is not working (still the same problem). I looked around internet and see people using WAMP with CakePHP then I downed new WAMP and installed on my machine. As expected, PHP and MySQL work fine with web browser but not from console ( still the same problem). I have set path point to the correct php and mysql (with XAMPP and WAMP) but can't get it working with console. Here is my path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\apache2triad\bin;C:\apache2triad\perl\bin;C:\apache2triad\php\bin;C:\apache2triad\mysql\bin;C:\apache2triad\opssl\bin;C:\apache2triad\python\bin;C:\apache2triad\pgsql\bin;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit-32;C:\xampp\mysql\bin;c:\xampp\php;C:\xampp\htdocs\cake\cake\console;C:\xampp\mysql\bin;C:\xampp\php\extensions;C:\xampp\php\ext;C:\wamp\bin\php\php5.2.8;C:\wamp\bin\mysql\mysql5.1.30\bin;C:\wamp\www\cake\cake\console;C:\wamp\bin;C:\wamp\bin\php\php5.2.8\ext; I thought the problem is at path setting and I tried and it is not working with XAMPP or WAMP ( new versions from their websites I downloaded and set up) if I use console (but I have not problem with this if I using internet or browsers). when I try this: cake bake model cake bake controller it shows Fatal error: Call to undefined function mysql_connect() in cake\libs\model\datasources\dbo\dbo_mysql.php on line 371 this call mysql_connect() function. PHP worked fine at console MySQL worked fine at console but when PHP calls MySQL at console it shows error. Can someone help me? I spent two days trying to solve this problem already.