News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Error on Windows / IIS host

Started by TID, September 23, 2005, 09:40:06 AM

Previous topic - Next topic

TID

Sorry about the duplicate post

How do I get round this error message?

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in D:\Clients\13335\dbnbf.com\dbnbf.com\install.php on line 767

TIA

Oldiesmann

That means it's trying to change to a non-existing directory... Not sure how you get rid of that or what's causing it.
Michael Eshom
Christian Metal Fans

beemer

Sounds like the directory structure is not correct, you are trying to install right?
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

TID

#3
The relevent lines in install.php are:

return doStep2a();
}

if (!file_exists($sourcedir . '/Subs.php'))
{
echo '
<div class="error_message">
<div style="color: red;">', $txt['error_subs_missing'], '</div>
</div>
<br />';

return doStep2a();
}

updateSettingsFile(array('webmaster_email' => $_POST['email']));

chdir(dirname(__FILE__));

define('SMF', 1);
require_once($sourcedir . '/Subs.php');
require_once($sourcedir . '/Subs-Auth.php');

$result = mysql_query("
SELECT ID_MEMBER
FROM {$db_prefix}members
WHERE memberName = '$_POST[username]' OR emailAddress = '$_POST[email]'
LIMIT 1");
if (mysql_num_rows($result) != 0)


I have checked all files and re uploaded everything, directory structure is right, but error persists when trying to install. It's the line chdir(dirname(__FILE__)); that seems to be having problems.

beemer

What version are you trying to install ?
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

TID


Oldiesmann

Put this in a file, upload it to your SMF directory and run it. Post the results here...

<?php
echo dirname(__FILE__);
?>


Prior to 4.3.0, PHP returned "." for the current directory.
Michael Eshom
Christian Metal Fans

TID

#7
Quote from: Oldiesmann on September 27, 2005, 07:04:26 PM
Put this in a file, upload it to your SMF directory and run it. Post the results here...

<?php
echo dirname(__FILE__);
?>


Prior to 4.3.0, PHP returned "." for the current directory.

File returned:-

D:\Clients\13335\dbnbf.com\dbnbf.com

which is the path to the SMF directory at http://www.dbnbf.com [nofollow]

Which at the moment has the permissions set wrongly, as every time I upload files their permissions are set back to the default and it seems the only way to change them is one at a time (takes for ever) via my hosts control panel, unles you know how to do it on a Windows server via ftp?

beemer

Change the folder and file permissions using your ftp software ?
http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

Oldiesmann

I don't know if you can change permissions via FTP on a windows server as I've never tried it. I'm not sure what the problem could be - if dirname(__FILE__) returns the appropriate directory name, then it should be able to open it...
Michael Eshom
Christian Metal Fans

beemer

Good point Oldiesmann damn windows!

TID  Have you are asked your hosting company to set permissiions?

I just followed your basic domain and it trys to run the SMF install straight off with the following message

You're on a windows server, and some crucial files are not writable. Please ask your host to give write permissions to the user PHP is running under for the files in your SMF installation. The following files or directories need to be writable:

    * attachments
    * avatars
    * Packages
    * Packages/installed.list
    * Smileys
    * Themes
    * agreement.txt
    * Settings.php
    * Settings_bak.php

Click here to try this step again.


http://www.bmw7resource.co.uk
SMF 1.1 RC1
MKP 1.1 RC1
Helios Multi RC1
-------------------------------------------------------
http://www.thefishsheadnhorsesarse.co.uk
SMF 1.1 RC2
TinyPortal 0.8.6

TID

I had them set the relevent files and folders to the unix equivelent of 777 when I uploaded 1.0.5. That is when install.php started to throw up the error in this thread.  I thought I'd try 1.1-rc1, so I uploaded the files which changed the permissions back to whatever my host set as the default, I'm now waiting for them to reset the permissions to 777 or whatever that equates to on a Windows server.

Windows is avery apt name, the O/S is as easy to break as a window.  Why the hell can't you change permissions while logged on remotely like unix?

Hmm?  Windows. . . Gates. . . What's next? . . . Doors maybe?  ;D

Ray™

#12
I think that D:\Clients\13335\dbnbf.com\dbnbf.com is a bad link -- windows will try to exec dbnbf.com as a file . try not using the .com and see if that fixes the problem
arcade-Only (over 800 Games)
http://www.arcade-only.com
Hand Made Ceramics
http://cbr.rranderson.com

TID

Quote from: Ray on September 28, 2005, 03:31:07 PM
I think that D:\Clients\13335\dbnbf.com\dbnbf.com is a bad link -- windows will try to exec dbnbf.com [nofollow] as a file . try not using the .com and see if that fixes the problem

I don't have that option.  That is the default driectory structure for all domains hosted by m6.net [nofollow].

I have four more domains hosted with them that work ok with that structure, mind you they are just straight html sites, no php or MySQL

http://www.the-iron-dutchess.com [nofollow] - D:\Clients\13335\the-iron-dutchess.com\the-iron-dutchess.com
http://www.the-iron-dutchess.co.uk [nofollow] - D:\Clients\13335\the-iron-dutchess.co.uk\the-iron-dutchess.co.uk
http://www.replica-dutch-barge.com [nofollow] - D:\Clients\13335\replica-dutch-barge.com\replica-dutch-barge.com
http://www.drugs-4u.com [nofollow] - D:\Clients\13335\drugs-4u.com\drugs-4u.com

Ray™

#14
I run windows and have the smf Dir set to read and write all when I install -- then I cut back after the install was done. In windows if you just make the smf Dir (or whatever you call it dbnbf.com) writeable, then copy the files over all the files and Dir will be writeable. Not sure if this will help you but it is something.
arcade-Only (over 800 Games)
http://www.arcade-only.com
Hand Made Ceramics
http://cbr.rranderson.com

Oldiesmann

You can try changing that line to this:

chdir('"' . dirname(__FILE__) . '"');
Michael Eshom
Christian Metal Fans

TID

Quote from: Oldiesmann on September 30, 2005, 10:28:59 AM
You can try changing that line to this:

chdir('"' . dirname(__FILE__) . '"');

WooHoo!  Well done that man!!!

Install.php still threw up a similar error at a different line number, but the install completed OK anyway.

Many thanks  :D

Advertisement: