Click to See Complete Forum and Search --> : [Resolved] the specfied module cannot be found


tuf-web.co.uk
07-19-2003, 09:48 AM
hey

i am trying to run php5 b1 on an apache 1.3.27 server

it works fine with php4.3.2 but i keep getting the error

the specfied module cannot be found

when i test my httpd.conf

my httpd line is

LoadModule php4_module c:/webroot/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php

any suggestions on how to fix this?!

thanks

Comms

tsinka
07-20-2003, 03:42 AM
Try to change

AddModule mod_php4.c

to

AddModule mod_php5.c

If that doesn't work change also

LoadModule php4_module c:/webroot/php/sapi/php4apache.dll

to

LoadModule php5_module c:/webroot/php/sapi/php4apache.dll

I read somewhere that the second one has only to be done when using apache 2.x and that you don't need it with apache 1.3.x. I'm using apache 2 so I can't tell it for sure. I think I read it in the user comments in the online php manual.

Thomas

tuf-web.co.uk
07-20-2003, 07:04 AM
nope that didnt work :(

i tried both, seperately and together, and apache still wouldnt run

could be this a problem with php 5?

thanks Comms

tsinka
07-20-2003, 08:37 AM
Please post the httpd.conf file

tuf-web.co.uk
07-20-2003, 09:42 AM
here you go

tsinka
07-20-2003, 11:05 AM
Ok,

first make sure that you copied php4ts.dll to the system32 directory (or system on w9x/me).

Then move the LoadModule directive to the end of the global LoadModul block (around line 193) and the AddModule directive to the end of the global AddModule block (around line 240).

Then try to restart apache.

Thomas

tuf-web.co.uk
07-20-2003, 01:43 PM
nope i still got the error message :(

tuf-web.co.uk
07-24-2003, 05:44 AM
anyone?

tsinka
07-26-2003, 02:40 AM
Hi,

sorry that I didn't reply for such a long time :)

Please post the most recent httpd.conf so I can see how it looks now.

What error message do you get exactly, just "the specfied module cannot be found" or anything else ?


Thomas

tsinka
07-26-2003, 02:42 AM
I forgot something:

Copy the contents of dlls to the system (W9x/ME) or system32 (NT/2K/XP/2003) directory and try to restart apache after that.

If you enabled any php extensions in the php.ini (which has to be in windows/winnt) make sure that the extension_path parameter in php.ini is set to the correct path.

Thomas

tuf-web.co.uk
07-26-2003, 10:41 AM
hey, no probs about the delay i just used php4 while i waited

i did what you said, moved all the dlls to system32, and there was a tip in antoher thread about an iconv.dll being moved into the sapi folder.

well after i did that, i ran apache and it worked fine but when i ran http://localhost/index.php nothing, but a white page showed up, although the title bar changed.

heres my httpd.conf

thanks for the help :)

tsinka
07-26-2003, 02:53 PM
Hi,

do you see php source code if you view the source code of the page ?

If you see the source try to change AddModule mod_php5.c to AddModule mod_php4.c.

Some people posted that they had to use mod_php4.c instead of mod_php5.c even with php 5 (don't know why).

Thomas

tuf-web.co.uk
07-26-2003, 03:13 PM
when i look at the source all i see is

<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>theutherfish.com</title>

which is in the of my included files called includes/header.php, which is loaded into my main page. this is loaded but i have another 3 includes which are directly after it and they arent being loaded :S

tuf-web.co.uk
07-26-2003, 03:17 PM
oops, i changed my httpd.conf so that the line

AddModule mod_php5.c
was
AddModule mod_php4.c

and i got another error

saying that the module couldnt be loaded via the name mod_php4.c in list of modules

tsinka
07-26-2003, 03:25 PM
Ok,

so that shouldn't be a configuration problem. Please post the/some code if possible.

tuf-web.co.uk
07-26-2003, 03:40 PM
first my index.php


<?
include("includes/header.php");
include("includes/auth/common.php");
include("includes/functions.inc");
include("includes/style.php");
?>

<body bgcolor="#6A6A6A" topmargin="0" bottommargin="3" leftmargin="0" rightmargin="0">

<table align="center" cellpadding="0" cellspacing="0" width="600" id="AutoNumber1">
<tr>
<td width="100%">

<table align="middle" border="0" bgcolor="#DDDDDD" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="600" id="AutoNumber1">
<tr>
<td width="100%">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#BBBBBB" width="100%" id="AutoNumber2">
<tr>


<td width="20" style="border-right-style: solid; border-right-width: 1" bgcolor="#CCCCCC" valign="bottom">
<img border="0" src="images/left_side.gif" width="20" height="200">
</td>



secondly header.php


<head>
<meta http-equiv="Content-Language" content="en-gb">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>theutherfish.com</title>


thirdly common.php


<?
@ $conn = mysql_pconnect("localhost", "****", "****")
or die("Could not connect");
@ $db = mysql_select_db("****") or die("could not select database");

?>


forth - functions.php


<?

function emoticons($comment) {
$newline = str_replace(':)','<img src="/images/emoticons/smiley.gif">',$comment);
$newline = str_replace(':(','<img src="/images/emoticons/frown.gif" width="18" height="18">',$newline);
$newline = str_replace(';)','<img src="/images/emoticons/wink.gif" width="18" height="18">',$newline);
$newline = str_replace(':P','<img src="/images/emoticons/nerr.gif" width="18" height="18">',$newline);
$newline = str_replace('(H)','<img src="/images/emoticons/cool.gif" width="18" height="18">',$newline);
$newline = str_replace(':@','<img src="/images/emoticons/mad.gif" width="18" height="18">',$newline);
$newline = str_replace(':D','<img src="/images/emoticons/vhappy.gif" width="18" height="18">',$newline);
$newline = str_replace(':S','<img src="/images/emoticons/wacko.gif" width="18" height="18">',$newline);
$newline = str_replace(':p','<img src="/images/emoticons/nerr.gif" width="18" height="18">',$newline);
$newline = str_replace('(h)','<img src="/images/emoticons/cool.gif" width="18" height="18">',$newline);
$newline = str_replace(':@','<img src="/images/emoticons/mad.gif" width="18" height="18">',$newline);
$newline = str_replace(':d','<img src="/images/emoticons/vhappy.gif" width="18" height="18">',$newline);
$newline = str_replace(':s','<img src="/images/emoticons/wacko.gif" width="18" height="18">',$newline);

echo $newline;

}

function home() {
$sql = "select * from stories ORDER BY id desc LIMIT 0,10";
$result = mysql_query($sql);

while ($row = mysql_fetch_array($result))
{
$comment = $row[story];
?>

<table border="1" bgcolor="#BBBBBB" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#000000" width="560" id="AutoNumber1">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber2">
<tr>
<td width="70%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3">
<tr height="20">
<td width="100%" align="left">
<font face="Verdana" size="2"><p style="margin-left: 3; margin-right: 3; margin-top: 0"><B><?=$row[headline]?></B></font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%"><br><font face="Verdana" size="2">
<p style="margin-left: 3; margin-right: 3; margin-top: 0">
<? emoticons($comment);

if ($story["edit"] != '') {
echo "<br><br>[edit]<br>";
$comment = $story[edit];
emoticons($comment);
}
else {
}

?> <br><br></td>
</tr>
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber5">
<tr>
<td align="right">
<font face="Verdana" size="2"><p style="margin-left: 3; margin-right: 3; margin-top: 3; margin-bottom: 3">

Message Posted By <?=$row[writer]?> On <?=$row[time]?>

</font></td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<?
}
}

function menu () {
?>

<script language="JavaScript" src="sitemap_scr.js">
</script>


<table id="m1mainSXMenu2" cellspacing="0" cellpadding="5" class="x1" border="0" width="560">
<tr align="left">

<td onmouseover="chgBg(m1,'m1tlm0',3);exM(m1,'none','',event)" onmouseout="chgBg(m1,'m1tlm0',0,1)" id="m1tlm0" class="m1mit" bgcolor="#CCCCCC">
<a id="m1tlm0a" class="m1CL0" href="http://www.theutherfish.com" >
<div class='topFold'>Home</div></a></td>

<td onmouseover="chgBg(m1,'m1tlm1',3);exM(m1,'m1mn1','m1tlm1',event)" onmouseout="chgBg(m1,'m1tlm1',0);coM(m1,'m1mn1')" id="m1tlm1" class="m1mit" bgcolor="#CCCCCC" >
<a id="m1tlm1a" class="m1CL0" href="javascript:void(0);" onMouseOver="exMNS(m1,'m1mn1',event)" onmouseout="coMNS(m1,'m1mn1')" >
<div id='m1mn1top' class='topFold'>Content</div></a></td>

<td onmouseover="chgBg(m1,'m1tlm2',3);exM(m1,'m1mn2','m1tlm2',event)" onmouseout="chgBg(m1,'m1tlm2',0);coM(m1,'m1mn1')" id="m1tlm2" class="m1mit" bgcolor="#CCCCCC" >
<a id="m1tlm2a" class="m1CL0" href="javascript:void(0);" onMouseOver="exMNS(m1,'m1mn2',event)" onmouseout="coMNS(m1,'m1mn2')" >
<div id='m1mn1top' class='topFold'>Misc</div></a></td>

<td onmouseover="chgBg(m1,'m1tlm3',3);exM(m1,'m1mn3','m1tlm3',event)" onmouseout="chgBg(m1,'m1tlm3',0);coM(m1,'m1mn1')" id="m1tlm3" class="m1mit" bgcolor="#CCCCCC">
<a id="m1tlm3a" class="m1CL0" href="javascript:void(0);" onMouseOver="exMNS(m1,'m1mn3',event)" onmouseout="coMNS(m1,'m1mn3')" >
<div id='m1mn1top' class='topFold'>Other</div></a></td>

</tr></table>

<?
}

function welcome() {

if(isset($_COOKIE['user'])) {

$sql = "SELECT
* FROM custom
WHERE username
= '".$_COOKIE['user']."'";

$query = mysql_query($sql) or die("could not select records");

while ( $row = mysql_fetch_array($query) ) {
echo "Welcome, <b>".$row["fname"]."</b>! ( <a href=/users/index.php>User CP</a> | <a href=/users/logout.php>Log Out</a>)";
}
}
else
{
echo "Welcome <b>Guest</b>! ( <a href=/users/login.php>Login</a> | <a href=/users/register.php>Regsiter</a> )";
}

}

?>


and finally style.php


<?

if(isset($_COOKIE['user'])) {

$sql = "SELECT * from custom where username='".mysql_escape_string(trim($_COOKIE['user']))."'";
$result = mysql_query($sql) or die(mysql_error());

while( $row = mysql_fetch_array($result) ) {

?>

<style>
<!--


a:link {font-size : <?=$row['linksize']?>px; color : #<?=$row['link']?>; font-weight : bold; text-decoration : none; font-family : <?=$row['linkface']?>}
a:visited {font-size : <?=$row['linksize']?>px; color : #<?=$row['visited']?>; font-weight : bold; text-decoration : none; font-family : <?=$row['linkface']?> }
a:hover {font-size : <?=$row['linksize']?>px; color : #<?=$row['hover']?>; text-decoration : underline; font-weight : bold; font-family : <?=$row['linkface']?> }
a:active {font-size : <?=$row['linksize']?>px; color : #<?=$row['active']?>; text-decoration : underline; font-weight : bold; font-family : <?=$row['linkface']?> }
.{font-family : <?=$row['fontface']?>; font-size : <?=$row['fontsize']?>px; color : #<?=$row['fontcolor']?>; }
TABLE.user{background-color : #<?=$row['table']?>}

-->
</style>

</head>

<body bgcolor="<?=$row['bgcolor']?>" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<? } } else { ?>

<style>
<!--

a:link {font-weight : bold; text-decoration : none; font-family : verdana; font-size : 12px;}
a:visited {color : black; font-weight : bold; text-decoration : none; font-family : verdana; font-size : 12px;}
a:hover {color : red; text-decoration : none; font-weight : bold; font-family : verdana; font-size : 12px;}
a:active { color : red; text-decoration : none; font-weight : bold; font-family : verdana; font-size : 12px;}
.{font-family : verdana; font-size : 12px; color: #000000;}
TABLE.user{background-color : #DDDDDD}

-->
</style>

</head>

<body bgcolor="#6A6A6A" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<? } ?>


hope this helps :rolleyes:

tsinka
07-26-2003, 04:00 PM
Hi,

maybe a database connection problem. You use the @ character in a way that would suppress any warnings.

Change


<?
@ $conn = mysql_pconnect("localhost", "****", "****")
or die("Could not connect");
@ $db = mysql_select_db("****") or die("could not select database");
?>


to


<?
$conn = @mysql_pconnect("localhost", "****", "****")
or die("Could not connect: ".mysql_error());
$db = @mysql_select_db("****") or die("could not select database: ".mysql_error());
?>


Thomas

tuf-web.co.uk
07-26-2003, 04:07 PM
ok, i did that, i dont know why i had @ there, some newb mistake from about a year ago!

this was the outcome

Fatal error: Call to undefined function: mysql_pconnect() in c:\webroot\www\includes\auth\common.php on line 2

tsinka
07-26-2003, 04:45 PM
This is a weird problem. Du to licensing issues MySQL support has been removed from php 5.0.0 Beta 1. php 5.0.0 Beta 2 seems to include MySQL support, you can download it from

snaps.php.net

MySQL switched to GPL license which conflicted with the PHP license. MySQL and the PHP people are working on a solution.

Unbelievable ...

tuf-web.co.uk
07-26-2003, 04:55 PM
hey again!

i downloaded php5b2 and i still get the error message
i checked to see if i had installed it properly using phpinfo(); and it says my current version is

PHP Version 5.0.0b2-dev

so i guess i installed it properly, so why is it doing this still?!

tuf-web.co.uk
07-26-2003, 05:02 PM
hey, i was looking around phpinfo and found this

SERVER_SOFTWARE Apache/1.3.27 (Win32) PHP/5.0.0b1

which indicates that i have php5b1 which is not what i want :S

any further help?!

thanks

tsinka
07-27-2003, 03:02 AM
Ok,

I downloaded the latest snapshot 200307270230 and installed it. I copied php4ts.dll and all the contents of dlls to system (could test it on W98 only this time). I changed the httpd.conf to use the new php build and it worked. I still got the undefined function message but then saw that you have to enable MySQL support as extension. There is a extension=php_mysql.dll line in the new php.ini that comes with that build.

Replace the php.ini with the new one and enable the extension. Unfortunately it seems that the new build only supports MySQL on NT/2K/XP since it uses dll's that only exist on that Windows versions. If you're on Windows NT/2K/XP it should work ...

Thomas

tsinka
07-27-2003, 03:51 AM
Should work on 9x/ME also, seems like I accidently replaced an odbc dll with a wrong version.

tsinka
07-27-2003, 05:15 AM
No,

I forgot to set the extension_dir configuration parameter in php.ini (make sure that it points to the correct php extensions directory).

tuf-web.co.uk
07-27-2003, 06:10 AM
hey,

i realised this also in my daily search! :)

but when i ran apache it said the it couldnt load the extension, and the path it gave with the error message is correct. it seems that what happened earlier with the load module is now happening with the extensions

tsinka
07-27-2003, 07:10 AM
I had the same problem first but was able to solve it this way:

1) copy all the files in dlls to system/system32 and overwrite the existing ones
2) the main reason for this error:

set extension_path in php.ini to the extensions path of php beta 2, e.g.

extension_dir=c:\wamp\php5b2\extensions

(I'd suggest to use the php.ini that comes with php 5 Beta 2, make sure that it exists in windows/winnt

3)
make sure that none of the dll's belonging to the other php versions are in any of the directories specified in PATH environment variable and/or windows/system/system32

Make sure that none of the dll's in the dlls directory exist in the sapi directory.

After that I had no problems to use the php 5 Beta 2 MySQL functions.

tuf-web.co.uk
07-27-2003, 07:44 AM
yay tht worked, i thought i had another error but i forrgot to start mysql, silly me

thanks for the help :D