Bug 787 - [Chameleon-AdminTools]PHP errors and warnings appear when loading admin page
: [Chameleon-AdminTools]PHP errors and warnings appear when loading admin page
Status: VERIFIED FIXED
: Chameleon
AdminTools
: 1.99
: PC Linux
: P2 normal
: 2.0 RC 1
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-10-28 16:15 by
Modified: 2004-12-08 11:28 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-10-28 16:15:52
I load the admin page by typing the following URL:

http://server/chameleon_beta_admin/htdocs/main.phtml and PHP errors and warnings
appear.  There is also an Apache error.  See below.

I dig a little on one of the PHP error that says that this "server.dbf.struct"
file cannot be opened.  I check to see if I could find this file under Chameleon
root directory and could not.

Chris could you check if you have the same errors on Windows?

Fedora Core 2
Chameleon 20041022 beta 3


----------------
PHP warnings and errors:

[28-Oct-2004 16:11:12] PHP Notice:  Undefined index:  gszServerDataPath in
/home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/manage_servers.phtml on
line 143
[28-Oct-2004 16:11:12] PHP Notice:  Undefined index:  szServerDataPath in
/home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/manage_servers.phtml on
line 144
[28-Oct-2004 16:11:12] PHP Notice:  Undefined index:  gszServerDataPath in
/home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/manage_servers.php.inc on
line 18
[28-Oct-2004 16:11:12] PHP Notice:  Undefined index:  gszServerDataPath in
/home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/manage_servers.php.inc on
line 94
[28-Oct-2004 16:11:12] PHP Warning:  fopen(server.dbf.struct): failed to open
stream: Permission denied in
/home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/dbf.php on line 184
[28-Oct-2004 16:11:12] PHP Warning:  fwrite(): supplied argument is not a valid
stream resource in
/home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/dbf.php on line 185
[28-Oct-2004 16:11:12] PHP Warning:  Unable to create database (13): Permission
denied in /home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/dbf.php on line 188
[28-Oct-2004 16:11:12] PHP Warning:  Unable to find database for identifier 0 in
/home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/server_data_manager.php
on line 213
[28-Oct-2004 16:11:12] PHP Warning:  Unable to find database for identifier 0 in
/home/nsavard/proj/chameleon_beta/htdocs/common/phpwms/server_data_manager.php
on line 238
 

-------------------
Apache:

[Thu Oct 28 16:11:12 2004] [error] [client 127.0.0.1] open: No such file or
directory, referer: http://127.0.0.1/nsavard/chameleon_beta_admin/htdocs/main.phtml
------- Comment #1 From 2004-10-28 17:52:33 -------
nope. I checked my Apache error log file and nothing.

how is you "chameleon_beta_admin" defined in your Apache config?
In ms4w is defined as:

Alias /chameleon/admin "/ms4w/apps/chameleon/admin/htdocs"
<Directory "/ms4w/apps/chameleon/admin/htdocs/">
  AllowOverride None
  Options Indexes FollowSymLinks Multiviews 
  Order allow,deny
  Allow from all
</Directory>
------- Comment #2 From 2004-10-28 17:56:42 -------
I also check on my fedora machine and I did not get any errors.

in my apache log.
------- Comment #3 From 2004-10-29 07:10:42 -------
Changed target to 1.99 RC 1.
------- Comment #4 From 2004-10-29 08:48:31 -------
Chris "chameleon_beta_admin" is in my msapps and is defined like this:

"/home/nsavard/proj/chameleon_beta/admin/".

Also there is not only an Apache error but PHP errors too.
------- Comment #5 From 2004-10-29 12:16:20 -------
I have fixed the index warnings and am looking at the cuase of the other
problem.
------- Comment #6 From 2004-10-29 12:52:15 -------
Ok, I have fixed the index warnings in CVS
(.../common/phpwms/manage_servers.phtml & .php.inc).

Norm can you get this latest version of these files and please check the
permissions on the .../common/phpwms/ directory as well as the permissions on
any dbf files that are contained in that directory?
------- Comment #7 From 2004-10-29 16:25:25 -------
I just updated my source for Chameleon.  I have the same permissions set as in
CVS and I got the following messages:

[29-Oct-2004 16:23:42] PHP Notice:  Undefined index:  gszServerDataPath in
/home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/manage_servers.php.inc on
line 97
[29-Oct-2004 16:23:42] PHP Warning:  fopen(server.dbf.struct): failed to open
stream: Permission denied in
/home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/dbf.php on line 184
[29-Oct-2004 16:23:42] PHP Warning:  fwrite(): supplied argument is not a valid
stream resource in /home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/dbf.php
on line 185
[29-Oct-2004 16:23:42] PHP Warning:  Unable to create database (13): Permission
denied in /home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/dbf.php on line 188
[29-Oct-2004 16:23:42] PHP Warning:  Unable to find database for identifier 0 in
/home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/server_data_manager.php on
line 213
[29-Oct-2004 16:23:42] PHP Warning:  Unable to find database for identifier 0 in
/home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/server_data_manager.php on
line 238
------- Comment #8 From 2004-11-08 21:07:18 -------
Just to rule out the obvious ;) 

You say you updated your Chameleon source, did that also happen to include and
update for the common directory?  i.e. php_utils ?
------- Comment #9 From 2004-11-09 08:54:09 -------
Now I take no chance I always update both in sync:  Chameleon and php_utils.
------- Comment #10 From 2004-11-09 09:26:10 -------
I updated Chameleon and php_utils sources again today (Nov 9th 9h13). 
Everything works as expected.  This bug is fixed for me.
------- Comment #11 From 2004-11-09 17:52:53 -------
Dismiss comment #10.  The error comes out again and I know exactly when.  This
happens after I set the value for the "web_server_path" variable and apply the
change.  I tracked down the bug.  The Apache errors is displayed when line 208 
of "server_data_manager.php" file is reached.  This line is:
"$db = $this->oWMSDatabase->getDB( DB_SERVER );".  I check to what "DB_SERVER"
is set and it is set to "server.dbf" in "dbf.php" file.


And I don't know why the "gszServerDataPath" session variable is not set.

The permissions for "common/phpwms/" directory  and the only dbf file
(phpwms.dbf") are 664.  I changed them to 777 to make a test and I'm still have
the same error messages.

I don't know if it could help you.
------- Comment #12 From 2004-11-10 11:22:45 -------
Bill maybe you could reassign it to Julien to verify this issue or if you want I
can create an account for you on my machine.
------- Comment #13 From 2004-11-11 07:54:16 -------
No worries Norm, give me a chance to look at it, I will get to it. ;)  I will
let you know if I need an account.  Thanks.
------- Comment #14 From 2004-12-03 10:34:37 -------
This appears to have been foxed in a previous update.  Norm can you please
verify?

Thanks.
------- Comment #15 From 2004-12-03 11:43:54 -------
I checkout a fresh chameleon and php_utils today.  Same message as comment #7.
------- Comment #16 From 2004-12-03 12:00:40 -------
Norm, please update .../common/phpwms/manage_servers.php.inc and try again.  The
error message concerning the undefined index gszServerDataPath should NOT appear.

What are the permissions for the server.dbf.struct file?
------- Comment #17 From 2004-12-03 14:01:20 -------
I updated again php_utils and I got the messages below.

I asked Julien to update and test.  He got no message.  Julien checked on my
machine and changed common/phpwms directory permissions.  Only the Apache
message appears.

Question:  How should I know that I need to unprotect this directory?

Before line 190 of dbf.php file I added two echo lines:
           
	      echo "<pre>dir=$this->m_szBaseDir";
              echo "file=$szDBFFile</pre>";
And I got:

dir=file=server.dbf

So "szBaseDir" is not set.




__________________________
Messages:

[03-Dec-2004 13:18:49] PHP Warning:  fopen(server.dbf.struct): failed to open
stream: Permission denied in
/home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/dbf.php on line 190
[03-Dec-2004 13:18:49] PHP Warning:  fwrite(): supplied argument is not a valid
stream resource in /home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/dbf.php
on line 191
[03-Dec-2004 13:18:49] PHP Warning:  Unable to create database (13): Permission
denied in /home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/dbf.php on line 194
[03-Dec-2004 13:18:49] PHP Warning:  Unable to find database for identifier 0 in
/home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/server_data_manager.php on
line 216
[03-Dec-2004 13:18:49] PHP Warning:  Unable to find database for identifier 0 in
/home/nsavard/proj/chameleon_cvs/htdocs/common/phpwms/server_data_manager.php on
line 241
 
------- Comment #18 From 2004-12-03 14:29:36 -------
You shouldn't have to change the permissions on the phpwms directory, the files
should not be written there.

I will fix the code to write them into the config folder for chameleon.

1) So are all the errors gone now?  
2) What Apache message do you mean?
------- Comment #19 From 2004-12-03 15:19:22 -------
1) Yes all errors are gone.  

2)

[Fri Dec 03 13:59:08 2004] [error] [client 127.0.0.1] open: No such file or
directory, referer: http://127.0.0.1/nsavard/chameleon_cvs_admin/htdocs/main.phtml
------- Comment #20 From 2004-12-03 22:44:38 -------
Ok, I have updated the code to create WMS browser data files in the config
directory.  Updated ..../common/phpwms/manage_servers.phtml &
.../admin/htdocs/main.phtml.
------- Comment #21 From 2004-12-04 11:41:59 -------
I tested again after updating Chameleon and php_utils and no more PHP errors.  I
checked that files are created in config directory (very good).  The last thing
I got is the Apache error.
------- Comment #22 From 2004-12-04 14:13:14 -------
See comment #11 for more information on the Apache error.  I can also add this
piece of information.  Since your last changes Bill the Apache error is
appearing only one.  It is when "server.dbf" and "server.dbf.struct" files are
created.  After that reloading the admin page does not generate any Apache error.
------- Comment #23 From 2004-12-06 12:13:52 -------
Norm, I have found the source of the apache error and fixed it.  As well, I
spoke with Paul and have changed the destination directory for the dbf files to
the chameleon\data directory instead of the chameleon\config.

Everything should be working now, thanks for your patience. ;)
------- Comment #24 From 2004-12-08 11:28:47 -------
Verified on Fedora Core 2.  Thanks for fixing it.  Question:  Is it correct to
have the "phpwms.php" file created in the config directory?