Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » RADICORE Installation Issues » Login error and permissions error
Login error and permissions error [message #1424] Mon, 07 July 2008 02:10 Go to next message
jsmeaton is currently offline  jsmeaton
Messages: 9
Registered: May 2008
Junior Member
Hi Tony
Two queries for you..

Firstly, I can't log in even to a sample application. Following is the error I receive:

Fatal Error: File /latcs7/sys/httpd/htdocs/08pra06/source/radicore/xsl/std.det ail1.xsl does not exist... (# 256).

Error in line 949 of file '/home/team/08pra06/public_html/source/radicore/includes/inc lude.xml.php5.inc'.

Script: /08pra06/source/radicore/menu/logon.php


Which is correct, because latcs7/sys/httpd/htdocs/etc is NOT what should be showing up as our root.

For instance, our .htaccess file has the directive:

"php_value include_path ".:/home/team/08pra06/public_html/source/radicore/includes""

So I'm unsure why it is looking for our root to be the document root instead of a relative path from the includes directory.

I added my own debugging echo's and returned this information:

DEBUGGING INCLUDES/INCLUDE.XML.PHP5.INC >>>

DIR >> /08pra06/source/radicore
DOC ROOT >> /latcs7/sys/httpd/htdocs
FILENAME >> /latcs7/sys/httpd/htdocs/08pra06/source/radicore/xsl/std.det ail1.xsl
XSL_URL >> HTTP://[HOST-REMOVED]/08pra06/source/radicore/xsl/std.detail 1.xsl

----------------------

What I'm getting at is.. the XSL URL is the correct url for the file - yet the $filename property is looking in the wrong place.. namely the doc root of the entire web-server.. not our own local doc_root. $filename = $_SERVER['DOCUMENT_ROOT'] seems to be causing the problem. Do you know if this would be a server issue? Also, by editing this file to look for a relative path rather than the absolute.. will we potentially cause problems? Is $_SERVER['DOCUMENT_ROOT'] going to appear elsewhere and cause us similar problems?

-----------------------

Now a quicky regarding file permissions. The files we need to make writeable (errorlog.html for example) need to have a 777 permission correct? Isn't this a major security issue? Shouldn't a local script be doing the writing to files and then in essence it would only require that owner and group have write permission? 755 for everyone else?

Thank you for your help once again.
Re: Login error and permissions error [message #1425 is a reply to message #1424] Mon, 07 July 2008 05:20 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
(1) The filename which is constructed for the XSL directory is never relative to the 'includes' directory as this may be outside of the document root. An absolute pathname is constructed using $_SERVER['DOCUMENT_ROOT'] as its base, so if your script is being run from '/home/team/08pra06/public_html/source/radicore' then your document root should be '/home/team/08pra06/public_html'. If this is not what is being reported in $_SERVER['DOCUMENT_ROOT'] then there is something wrong with your server setup. If you have not installed radicore in or below your document root then you have not followed the installation instructions.

(2) File permissions - this is one thing that really annoys me about *nix systems, the fact that every PHP script run by the web server is automatically given the username of 'nobody' which is NOT the username of the domain. This then means that a PHP script running in that domain does not by default have permissions to create and write to files within that domain. It should be possible to change the permissions to 775 so that all members of the same group have the same permissions, but I have yet to find a way to discover what group 'nobody' belongs to, or what group the domain owner belongs to.

While it is not a good idea to change permissions to 777 on a global basis, it does not matter for errorlog.html as this is write-only. It is only a security risk or those files which are read by the application.


Re: Login error and permissions error [message #1458 is a reply to message #1425] Thu, 10 July 2008 21:28 Go to previous messageGo to next message
jsmeaton is currently offline  jsmeaton
Messages: 9
Registered: May 2008
Junior Member
Thanks for the reply. I've figured out the doc_root issue IS an apache configuration problem where the installation root is reported instead of the local (shared environment) root. I've got my administrator on to it.

For future reference there is a work around which involves checking to see if doc_root is set correctly, and if not.. derive the root in this fashion:

$absoluteFilename = __FILE__;
        $relativeFilename = $_SERVER['SCRIPT_NAME'];
        $absolutePathPos = strrpos($absoluteFilename, $relativeFilename);

        if ($absolutePathPos === false)
            return ''; /* Unable to retrieve document root */
        else
            return substr($absoluteFilename, 0, $absolutePathPos);


Thanks for your quick replies.
Re: Login error and permissions error [message #3012 is a reply to message #1458] Wed, 04 July 2012 10:06 Go to previous message
KentTeague is currently offline  KentTeague
Messages: 1
Registered: July 2012
Junior Member
This was my fix.

Replace line

$filename = $_SERVER['DOCUMENT_ROOT'] .$dir .'/xsl/' .$xsl_file;

with

$filename = '../xsl/' .$xsl_file;

My configuration is the following:
'DOCUMENT_ROOT' - C:/Docs/www
php_value include_path ".;C:\Docs\www\RADICORE\INCLUDES"
http://localhost/docswww/radicore/ is how start the system

So the error is:
Fatal Error: File name 'C:/Docs/www/docswww/Radicore/xsl/std.detail1.xsl' does not exist (# 256).

Error in line 1112 of file 'C:\Docs\www\Radicore\includes\include.xml.php5.inc'.

PHP_SELF: /docswww/Radicore/menu/logon.php

CURRENT DIRECTORY: C:\Docs\www\Radicore\menu





Previous Topic: Class 'radicore_view' not found
Next Topic: Apache modules
Goto Forum:
  


Current Time: Mon Mar 18 22:33:08 EDT 2024

Total time taken to generate the page: 0.01062 seconds