i've installed Apache 1.3.20 and PHP 4.06
i've added the following strings to the httpd.conf file
<VirtualHost 127.0.0.2>
    ServerName localhost2
    ServerAdmin [EMAIL PROTECTED]
    DocumentRoot "c:/inetpub/localhost2
    <Directory "c:/inetpub/localhost2">
        Options Includes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    ScriptAlias /cgi-bin/ "c:/inetpub/localhost2/cgi-bin/"
    ErrorLog "c:/inetpub/error.log"
    CustomLog "c:/inetpub/custom.log" common
</VirtualHost>

i've created folder c:\inetpub\localhost2 and added string 127.0.0.2
localhost2 to the HOSTS file.

everything works fine to this point. simple index.html file is shown after
the http://localhost2 request in browser URL

i've created FILES folder in the c:\inetpub\localhost2 folder and created
test.php file in the localhost2 folder

=========test.php============
<?
$dir_name = "/files";

$dir = @opendir($dir_name) or die( "Directory \"$dir_name\"not found.");

$file_list = "<ul>";


while ($file_name = readdir($dir)) {
if (($file_name != ".") && ($file_name != "..")) {
$file_list .= "<li>$file_name";
}
}


$file_list .= "</ul>";


closedir($dir);

?>

<!-- Start your HTML -->

<HTML>
<HEAD>
<TITLE>Directory Listing</TITLE>
</HEAD>
<BODY>


<!-- Use PHP to print the name of the directory you read -->

<P>Files in: <? echo "$dir_name"; ?></p>

<!-- Use PHP to print the directory listing -->
<? echo "$file_list"; ?>

</BODY>
</HTML>

==============/test.php=============

but when i try to execute this file, i see "Directory "/files"not found."
What i'm doing wrong ?





-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to