MySQL Forums
Forum List  »  PHP

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.

Options: ReplyQuote


Subject
Written By
Posted
Re: Fatal error: Call to undefined function mysql_connect() in C:\Program Files\Apache Group\Apache2\practice\testsql.php on line 17
February 22, 2009 06:06PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.