NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Need help connecting to MySQL


Joined: 02 Oct 2006
Posts: 2
Reply with quote
I'm having problems connecting to mysql

php5.05
mysql 4.1
phpED 4.6.1

Automated install on everything


Symptom: when I run a script (ctrl-F9) it reports, Call to undefined function mysql_connect() .

Reason: To me this means the php-mysql connector or libs are not loading properly.

Observations: When I run phpInfo() it tells me it is looking in c:\windows for php.ini. But there is no php.ini in c:\windows.

What I've done:
-I edited php.ini in the nusphere\phpED\php5 dir to include extension=php_mysqli.dll. I copied this to c:\windows. I downloaded php_mysqli.dll ver 5.1.6 from mysql.com and copied it to the php5\extensions dir.
-I copied the libmysql.dll from mysql 5.0 (even though I'm running 4.1. Is that okay?) over to the nusphere\phpED dir as you explain above.

What's happening now:
Error: When apache starts php5 it says it cannot load the dynamic library [various path\filename] - The specified procedure cannot be found.

The various files it says it can't find are all in the extension directory that is properly pointed to in php.ini so they should be found. They include:
php_mysqli.dll
php_mysql.dll
php_pgsql.dll
php_pdo.dll
php_pdo_sqlite.dll
php_pdo_mysql.dll
php_sqlite.dll
php_dbg.dll-5.1.x

Then it goes through and errors each of these files once again. Why is it doing that?

I tried changing permissions and unclicking 'readonly' for the extension directory. This didn't help.

Could you please outline in step-by-step detail how to get mysql(any version) running with php4 and php5. If this has already been done I have not been able to find it in the manual, FAQ, or forum, at least not inasmuch as it solved my problem.

Thank you,

Mike Z
View user's profileFind all posts by mzumpanoSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
Quote:
Symptom: when I run a script (ctrl-F9) it reports, Call to undefined function mysql_connect() .

It means you forgot to enable mysql extension in php.ini but it all is covered in FAQ faq-i-get-call-to-undefined-function-why-t765.html

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 02 Oct 2006
Posts: 2
Reply with quote
Dmitri, thank you for such a fast response. The extensions are enabled. It is looking for each of the extensions that are enabled and reporting that it cannot find them. I have carefully checked the path and the presence of each file. If the extensions were not enabled it would not look for them and throw an error. The extension directory was initially set to read-only. I removed that restriction but it made no difference. Could it be that it does not like the version of these dll's? Please take another look at my initial post. Here is what it is saying:


Error: When apache starts php5 it says it cannot load the dynamic library [various path\filename] - The specified procedure cannot be found.

The various files it says it can't find are all in the extension directory that is properly pointed to in php.ini so they should be found. They include:
php_mysqli.dll
php_mysql.dll
php_pgsql.dll
php_pdo.dll
php_pdo_sqlite.dll
php_pdo_mysql.dll
php_sqlite.dll
php_dbg.dll-5.1.x

Then it goes through and errors each of these files once again. Why is it doing that?

Thank you once again for trying to help me solve this problem,

Mike Z
View user's profileFind all posts by mzumpanoSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
I'd recommend you install php 5.1.6 and make sure that php.exe directory is listed in PATH or php5ts.dll is copied to Apache's bin directory.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 05 Jan 2005
Posts: 16
Location: Austria
Reply with quote
check for the correct version of libmysql.dll in one of the directories specified in the the PATH evironment variable.
View user's profileFind all posts by matSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
Quote:
check for the correct version of libmysql.dll

right, php_mysql.dll depends on libmysql.dll, but even with an "incorrect" libmysql.dll, it will be loaded.
So it's sufficient to check if library is available either in Apache process's directory or in the PATH.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Need help connecting to MySQL
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic