getting an illegal function call on an XP pc on code that works on a Windows server 2003

the code

$connect = mysql_connect('localhost',$user,$passwd)
      or die('could not connect: ' .  mysql_error());

The error when I try to run on the XP (Media vision with SP2)

Fatal error: Call to undefined function mysql_connect() in c:\Inetpub\wwwroot\lktest.php on line 15

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Please make sure that on your XP machine in php.ini you have enabled the mysql dll file.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Joseph MelnickSenior Software Developer - Pharmacy ApplicationsCommented:
Hello lewisekrantz,

Roonaan is correct. You error indicates that the function mysql_connect() is undefined therefore the libmysql.dll dynamic link library may not be available OR may have the wrong permissions etc. Mind you this is still pretty weird.

If you are using PHP 5+ php_mysql.dll extension needs to be activated in PHP.INI AND
the extension_dir directive needs to be set to the directory where your extensions live.

In PHP 4 MySQL support in compiled in so if it is this version then there are other things going on in your machine.

Is the PHP version that you are using on the server the same version that you are using on your XP machine?
Is the MySQL version the same as on your server?

PHP 4      +  MySQL version <4.1 use mysql extension
PHP 5    +  MySQL version >=4.1 use mysqli extension by default

Joseph Melnick (jmelnick)

If roonaan's suggestion does not work, try copying your dll file to your c:\windows\system32 directory and rebooting.
Joseph MelnickSenior Software Developer - Pharmacy ApplicationsCommented:
Suggest Split. My comment provides a solution. LinuxNubb and Roonaan provide good suggestions. Joseph Melnick.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.