Topic: trouble with install on m$ w2k3-iis6

I have just installed the latest version of punbb on the following server config
windows 2003 R2, IIS6.0, PHP4.4, MySQL 4.0.4
- created a website in IISADMIN with a distinct IP, 192.168.18.65
- The files were loaded to the physical location e:\web_forum
- In iis the website description name (forum) points to e:\web_forum.
- uploaded the required files
- created a mysql db
- ran http://192.168.18.65/install.php
- presumeably finished the intial setup
- created the config.php file

Now when I try to access the website I get the following error:

Notice: Undefined variable: pun_user in E:\web_forum\index.php on line 31
Notice: Undefined variable: pun_user in E:\web_forum\index.php on line 36
Warning: main(../lang/index.php): failed to open stream: No such file or directory in E:\web_forum\index.php on line 36
Fatal error: main(): Failed opening required '../lang/index.php' (include_path='.;c:\php\includes') in E:\web_forum\index.php on line 36

the install.php is as follows

// The PunBB version this script installs
$punbb_version = '1.2.12';

// define('PUN_ROOT', './');
// for windows .. define('PUN_ROOT', dirname(__FILE__).'./');
define('PUN_ROOT', dirname("forum"));

The index.php is as follows

// define('PUN_ROOT', './');
// for windows .. define('PUN_ROOT', dirname(__FILE__).'./');
define('PUN_ROOT', dirname("forum").'./');
// forum is the description for the web site identification in IIS
// the local path for the wesite files is "E:\web_forum"

if ($pun_user['g_read_board'] == '0')
    message($lang_common['No view']);

// Load the index.php language file
require PUN_ROOT.'lang'.$pun_user['language'].'/index.php';

$page_title = pun_htmlspecialchars($pun_config['o_board_title']);
define('PUN_ALLOW_INDEX', 1);
require PUN_ROOT.'header.php';

The config.php is as follows

<?php

$db_type = 'mysql';
$db_host = 'localhost';
$db_name = 'forum';
$db_username = 'root';
$db_password = '*******';
$db_prefix = 'pmg_';
$p_connect = false;

$cookie_name = 'punbb_cookie';
$cookie_domain = '';
$cookie_path = '/';
$cookie_secure = 0;
$cookie_seed = '58c741eb';

define('PUN', 1);

Can someone please help.
Thanks

Re: trouble with install on m$ w2k3-iis6

Make sure eveything is uploaded correctly.

Re: trouble with install on m$ w2k3-iis6

I am working locally on a LAN server. Basically, unzipped the package and copied into e:\web_forum.

Re: trouble with install on m$ w2k3-iis6

I really hope you didn't remove the require of include/common.php in the code hmm
Also, what's up with the odd dirname edits? PunBB doesn't need those, ./ works just fine in Windows hmm

Re: trouble with install on m$ w2k3-iis6

Are you sure that's PunBB and not some other forum based on PunBB? I sure as hell havn't written the "for windows .." comment stuff.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: trouble with install on m$ w2k3-iis6

Smartys wrote:

I really hope you didn't remove the require of include/common.php in the code hmm

The only files I tried to tweak were install.php and index.php, specifically // define('PUN_ROOT', './');
I haven't touched anything in common.php

Smartys wrote:

Also, what's up with the odd dirname edits? PunBB doesn't need those, ./ works just fine in Windows hmm

dirname edits from http://punbb.org/forums/viewtopic.php?id=8435
I tried // define('PUN_ROOT', './'); , but still getting errors.

Re: trouble with install on m$ w2k3-iis6

That's odd. It must be an IIS issue.

Question: Do you need IIS for anything except this? I mean, are you running ASP/ASP.NET scripts as well? If not, uninstall that sorry excuse for a webserver and install Apache.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: trouble with install on m$ w2k3-iis6

I believe I have fixed my install. Basically any page that has

define('PUN_ROOT', './');

needs to be changed to

define('PUN_ROOT', "e:\\web_forum\\");

So far these pages include;

install.php,
index.php
viewform.php
viewtopic.php
profile.php
login.php

While I am no coder AND I do appreciate all the work that has gone into this software, It seems to me that consideration might given in future releases for a global variable with respect to this define statement.

As a side note, I also had to change line 336 in install.php from

 require PUN_ROOT.'include/dblayer/mysql.php';

to

 require PUN_ROOT.'include\dblayer\mysql.php';

Thanks for the help smile

Re: trouble with install on m$ w2k3-iis6

hrmm, IIS requires backslashes? =/
Really, get Apache. PunBB works fine on it tongue

10

Re: trouble with install on m$ w2k3-iis6

Apache at this point is a wish list and a work in progress. For now I am implementing PunBB as a documentation central point for changes being made at a co-lo rack.

We will be moving to apache/*nix sometime in the future.

Thanks again.

11 (edited by Smartys 2006-08-21 23:01)

Re: trouble with install on m$ w2k3-iis6

I don't think IIS requires backslashes: phpBB doesn't use them and it has no issues

Of course, I don't have and have never used IIS, so I can't test to see tongue

12

Re: trouble with install on m$ w2k3-iis6

I really wish my propellar spun fast enough...then I could tell you.  Unfortunately I am a lowly network admin that bang'd away at this using trial an error. All I can say is now it works. I even asked for help from an intern who is a php programmer. Both of us scratched our heads.

hmmmm..

Thanks

Re: trouble with install on m$ w2k3-iis6

And if you install PunBB without making the edits suggested in that thread? What errors do you get?

14

Re: trouble with install on m$ w2k3-iis6

The Apache 2.x msi installer is very simple, as is the MySQL one. PHP is the only install that you would have to go through the readme to understand.

15

Re: trouble with install on m$ w2k3-iis6

Smartys wrote:

And if you install PunBB without making the edits suggested in that thread? What errors do you get?

These two lines were caused from accidentally removing the line of code,
require 'PUN_ROOT'.'/include/common.php'; hmm

Notice: Undefined variable: pun_user in E:\web_forum\index.php on line 31
Notice: Undefined variable: pun_user in E:\web_forum\index.php on line 36

These two lines of code result from using ,
define('PUN_ROOT','./');

Warning: main(../lang/index.php): failed to open stream: No such file or directory in E:\web_forum\index.php on line 36
Fatal error: main(): Failed opening required '../lang/index.php' (include_path='.;c:\php\includes') in E:\web_forum\index.php on line 36

In the php.ini file when used on a windows system, you have to use the following. Note the forward slashes under the Windows comment. This is in every php.ini file I have ever setup.

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"  
;include_path = ".:/php/includes"
;
;
; Windows: "\path1;\path2"
include_path = ".;c:\php\includes"

Regards,

Don

Re: trouble with install on m$ w2k3-iis6

You sure you got those errors from a completely unmodded PunBB? Because the second set of errors (the ones with language) look to be related to the missing common.php (due to the missing $pun_user['language'] bit)

17

Re: trouble with install on m$ w2k3-iis6

I'm pretty sure, but not 100%. The only way I can be sure is to un-do what I have working and reinstall, and really don't want to do this again. I will look to find a spare test box to duplicate the process and report back later.

18 (edited by MrMister 2006-08-22 11:08)

Re: trouble with install on m$ w2k3-iis6

I'm using Win2k3 with IIS and have no issues with PunBB.
I'm also integrating a bittorrent tracker onto Punbb (the tracker uses Punbb's style engine and user table and defined permissions with some added tables for bittorrent stuff such as uploaded and downloaded values. It was a pain writing the converter, let me tell you, one massive SQL query, takes 90 seconds to insert over 40k posts from the old forum) and also have no problem adding the code below:

define('PUN_ROOT', '../');
define('PUN_QUIET_VISIT', 1);
define('PUN_ALLOW_INDEX', 1);
require_once PUN_ROOT.'include/common.php';

PS: I wish the pagination bug was fixed since on a topic I have with over 12k posts (don't ask smile) I get 3 extra empty pages at the end sad

EDIT: I've seen a lot of people complaining that you can only get load values in Apache/*nix so I made a CPU "in use" meter (returns the same value you get in Task Manager) for PHP in Windows if anyone wants it. Warning: It most likely will not work on shared web space.

19

Re: trouble with install on m$ w2k3-iis6

define('PUN_ROOT', '../');
define('PUN_QUIET_VISIT', 1);
define('PUN_ALLOW_INDEX', 1);
require_once PUN_ROOT.'include/common.php';

your line define('PUN_ROOT','../'); has two dots for '../'

This is different for all my newly installed files. My original files only had one dot for './'
Did you change this when you setup PunBB ?

btw...what is the purpose for PUN_QUIET_VISIT and PUN_ALLOW_INDEX ?

Thanks

Re: trouble with install on m$ w2k3-iis6

24jedi wrote:

btw...what is the purpose for PUN_QUIET_VISIT and PUN_ALLOW_INDEX ?

They determine whether or not users visiting a particular page will be added to the online list and whether or not PunBB will generate a NOINDEX meta tag for the page, respectively.

Looking for a certain modification for your forum? Please take a look here before posting.

21 (edited by MrMister 2006-08-22 20:30)

Re: trouble with install on m$ w2k3-iis6

I was working at the converter at the time and did a copy/paste. Sorry, didn't catch that.
Since it's in a subdirectory inside the punbb dir, it needs the 2 dots so that it points at the root of the punbb dir and when it's added below (PUN_ROOT.'include/common.php') it points to the right path.

BTW, the mods keep saying that $db is correctly globalized, but my experience is that I always have to do a "global $db" to have it work inside functions. No idea if it's Windows/IIS/PHP version related.

EDIT: just remembered something. the error "failed to open stream: No such file or directory" and similar other errors can also be caused by NTFS permissions on the files. Make sure that the user that IIS uses (by default it's IUSR_yourservername) has the necessary permissions.

22 (edited by Smartys 2006-08-22 20:46)

Re: trouble with install on m$ w2k3-iis6

BTW, the mods keep saying that $db is correctly globalized, but my experience is that I always have to do a "global $db" to have it work inside functions. No idea if it's Windows/IIS/PHP version related.

Yes, that's the way functions work tongue
No variables from the global scope (except for the superglobals, $_GET, $_POST, etc) are in a function unless specified by a "global" declaration tongue