Fatal error: unidentified function mysql_connect()...?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

User avatar
boo_lolly
Forum Contributor
Posts: 154
Joined: Tue Nov 14, 2006 5:04 pm

Fatal error: unidentified function mysql_connect()...?

Post by boo_lolly »

I've tried google, and i've searched the forums... but i can't find an answer to why i'm getting this error? what does it mean?

Code: Select all

Fatal error: Call to undefined function mysql_connect() in D:\Htdocs\rockdaleisd.net\azureadmin\lib\db.php on line 11
PHP Warning: PHP Startup: Unable to load dynamic library './php_mysql.dll' - Invalid access to memory location. in Unknown on line 0
basically, i've been given the task to re-assemble a client's directory structure. so i've installed php and mysql, and copied the contents of their database, and copied their directory structure over to a test environment. it's on a windows 2003 server, by the way. can i get any help?

here's index.php

Code: Select all

<?php
 $inPreview  = "1";
 include_once("config/settings.php");
 include_once("azureadmin/lib/db.php");
 include_once("azureadmin/lib/sessions.php");
 $dbh=DBConnect();
// $config=LoadConfig();
 $session=getSession(SESSION_NAME);

 $id=$session['MEMBER_ID'];
 $id="137";
 $memData=SQLSelect("SELECT NICKNAME from members WHERE ID='$id'");
 $nickname=$memData[0]['NICKNAME'];
 include_once("azureadmin/lib/templates.php");

 include ("usersites/$nickname/content.php");
?>
Last edited by boo_lolly on Fri Jan 26, 2007 4:36 pm, edited 1 time in total.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

it means php can't find your mysql dll file...
User avatar
boo_lolly
Forum Contributor
Posts: 154
Joined: Tue Nov 14, 2006 5:04 pm

Post by boo_lolly »

The Ninja Space Goat wrote:it means php can't find your mysql dll file...
right, well what's that lib file? where do i get one? did it not install when i compiled php or mysql? why didn't it get installed?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You compiled PHP?
User avatar
boo_lolly
Forum Contributor
Posts: 154
Joined: Tue Nov 14, 2006 5:04 pm

Post by boo_lolly »

feyd wrote:You compiled PHP?
installed. you know what i mean :oops:
User avatar
boo_lolly
Forum Contributor
Posts: 154
Joined: Tue Nov 14, 2006 5:04 pm

Post by boo_lolly »

i ran a search and i found php_mysql.dll in the following directories:

Code: Select all

C:\PHP
C:\WINDOWS\system32
PHP/ext
D:\rockdaleisd.net\risd\restore\MySQL\MySQL Server 5.0\bin
D:\Htdocs\rockdaleisd.net\risd\restore\MySQL\MySQL Server 5.0\bin
Inetpub/wwwroot/rist/restore/MySQL/MySQL Server 5.0/bin
D:\Htdocs\rockdaleisd.net\rockdaleisd.net\risd\restore\MySQL\MySQL Server 5.0\bin
so it's there.... maybe it's in the wrong place?? i tried opening it in the Vim file editor but it comes up just a bunch of random characters.
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

have you checked to ensure the php_mysql extension is uncommented in php.ini?
User avatar
boo_lolly
Forum Contributor
Posts: 154
Joined: Tue Nov 14, 2006 5:04 pm

Post by boo_lolly »

Jenk wrote:have you checked to ensure the php_mysql extension is uncommented in php.ini?
yes i have... it is...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I suggest re-installing php completely.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

volka wrote:I suggest re-installing php completely.
To continue this thought: .... from the zip, no installer, just the zip.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

previously on battlestar devnet...
feyd wrote:
volka wrote:I suggest re-installing php completely.
To continue this thought: .... from the zip, no installer, just the zip.
and now the continuation:
or if it must be an installer use the xampp installer

.oO( although the new php/win32 installer from php.net really is an improvment compared to previous versions )
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't know if I'll every try the "new" installer considering how useless the older ones were.. :P
User avatar
boo_lolly
Forum Contributor
Posts: 154
Joined: Tue Nov 14, 2006 5:04 pm

Post by boo_lolly »

it turns out that the simulated environment i'm working on had php 5.1.2. i upgraded and installed 5.2.0 on it, made the necessary revisions to php.ini, and i restarted IIS (Windows 2003 Server). now, when i go to the index.php page... it says it can't find it... i don't get any mysql or php errors (which is awesome), but now it says Error 404, page cannot be found. i have no idea why. i don't work with windows. i'm a linux user, our technician put this server together (and he is very good at windows stuff). but, i'm the developer, so i'm supposed to figure this stuff out... i have no idea where to start. please help. your advice has worked so far =)

i don't know if this makes a difference, but everything PHP related is in C:\PHP but my i have D:\Htdocs in the D-drive.
User avatar
boo_lolly
Forum Contributor
Posts: 154
Joined: Tue Nov 14, 2006 5:04 pm

Post by boo_lolly »

i downloaded all the extensions and added them to my C:\PHP folder from a zip file, then i restarted IIS server, and NOW.... it gives me the following error:

Code: Select all

CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers.
...?
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

Have you considered trying Uniform Server? It comes with php 5.1.1, but most of the PECL libs are there... and you can drop in the latest php version if you want.

Oh, and no installer, just a zip and a "start.bat".
Post Reply