base directory problem base directory problem
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

base directory problem

Started by whazzup, December 28, 2003, 02:35:57 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

whazzup

Install went fine, chmod 77 to the appropriate directories, silly_safe_mode line inserted in config.inc.php, edited config table to have the directory without trailing slash (as i read somewhere on this board), also tried with trailing slash,  but...

When I login as admin (all fine) and goto the config page and try to submit changes it brings me back to yhe /config.php instead of the /fotoalbum/config.php subdirectory where i installed the script.

Same happens with all commands i use while in admin mode and when i log out. They bring me back to the root. Can't do anything else. Probably a silly mistaka to maka but nevertheless.. Can't find any table or config file where i should add the base installation directory. Anyone please? Thanks!
Smile. Tomorrow will be worse

Joachim Müller

edit config.php, find<form action="$PHP_SELF" method="post">and change it to<form action="config.php" method="post">
GauGau

whazzup

cool, that worked for the config... but not for the other pages and functions:

tried:
- add user (same problem, to root)
- create new group
- create category
- other functions... as well as after logging IN (after the welcome message).

so for the config it worked, but have not been able to use the other functions.

Could it have something to do with $gallery_url_prefix?

Thanks for your quick response!

Theo

btw same thing wit sending e-cards... all functions seem to refer to the root of my web insted of the installation directory.
Smile. Tomorrow will be worse

Joachim Müller

if the var $PHP_SELF doesn't work for you on all pages, edit the place where it initially is set up: edit init.inc.php and look for
Quote// Initialise the $CONFIG array and some other variables
$CONFIG = array();
$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
$REFERER = urlencode($PHP_SELF . (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING'] ? '?' . $HTTP_SERVER_VARS['QUERY_STRING'] : ''));
$ALBUM_SET = '';
$FORBIDDEN_SET = '';
$CURRENT_CAT_NAME = '';
$CAT_LIST = '';
and modify the red line accordingly.

GauGau

whazzup

i have this line in my init.inc.php already. Do you mean i should replace the variable with the url? like:

$PHP_SELF = isset($HTTP_SERVER_VARS['http://www.defakkel.com/fotoalbum']) ? $HTTP_SERVER_VARS['http://www.defakkel.com/fotoalbum'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];

I tried that... and that does not work...

Tnx.
Smile. Tomorrow will be worse

Joachim Müller

umph... sure, the stuff I quoted is the code that's already there, and the thing you tried won't work of course.
Take a look at phpinfo() and look for $HTTP_SERVER_VARS['SCRIPT_NAME'] and $HTTP_SERVER_VARS['REDIRECT_URL']). You might as well want to check $_SERVER["PHP_SELF"], $_SERVER["SCRIPT_NAME"] and $PHP_SELF (in fact the server vars)...
Tell us what you got there...

GauGau

whazzup

I am sorry. You totally lost me now. What should i get where? :cry:

I have followed your link, which brings me to the PHP manual.

I have a phpinfo.php in my root at www.defakkel.com but all that information does not make any sense to me.

I have tried the phpinfo.php at www.defakkel.com/fotoalbum but I am affraid it all looks spagetti to me. Other than a "Notice: Constant SILLY_SAFE_MODE already defined in /data/members/paid/d/e/defakkel.com/htdocs/www/fotoalbum/include/config.inc.php on line 4" when i execute phpinfo provided with the package, then the normal interface and then some information I can't really interpret.

I am not a skilled php programmer (not a programmer at all), all i do is have my way with the variables and that normally works fine. Got Yabb working fine as i did with Mambo, but this is beyond me. So I am affraid i got nothing :-(

So for short... lost!
Smile. Tomorrow will be worse

Joachim Müller

just create a phpinfo output as stated in the php.net manual, upload it to your webserver, run it in your browser. Then scroll to the bottom, copy-and-paste the block that is labelled "PHP Variables" into your next posting here on the board. We'll then have a look at the vars that you have on your server and will together find out what changes need to be applied to init.inc.php to make it work properly.

GauGau

whazzup

pfew... thought i was loosing it.. phpinfo does not give me back the variables. Just a clear page. (INFO_MODULES) (INFO_CONFIGURATION) and all the others work, but not the (INFO_VARIABLES). I missed those when i tried  ()  - so tried phpinfo(INFO_VARIABLES).

Was browsing even beyond the bottom of my page at warp speed yo find any cloaked variables devices, but I suppose those damn Lycos Klingons did it again :roll: ... See for yourself at www.defakkel.com/phpinfo.php (a complete phpinfo()).
Smile. Tomorrow will be worse

Joachim Müller

oh yeah, the benefits of free webhosting :wink: . Try printing the required vars with a script, like this:<?php
print "$HTTP_SERVER_VARS['SCRIPT_NAME'] =".$HTTP_SERVER_VARS['SCRIPT_NAME']."<br />";
print 
"$HTTP_SERVER_VARS['REDIRECT_URL'] =".$HTTP_SERVER_VARS['REDIRECT_URL']."<br />";
print 
"$_SERVER['PHP_SELF'] =".$_SERVER['PHP_SELF']."<br />";
print 
"$_SERVER['SCRIPT_NAME'] =".$_SERVER['SCRIPT_NAME']."<br />";
print 
"$PHP_SELF =".$PHP_SELF ."<br />";
?>
GauGau

whazzup

actually it is not free hosting... I have a web package at lycos. Script returns:

Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /data/members/paid/d/e/defakkel.com/htdocs/www/test.php on line 2
Smile. Tomorrow will be worse

Titooy

Remove the first $'s
<?php 
print "HTTP_SERVER_VARS['SCRIPT_NAME'] =".$HTTP_SERVER_VARS['SCRIPT_NAME']."<br />"
print 
"HTTP_SERVER_VARS['REDIRECT_URL'] =".$HTTP_SERVER_VARS['REDIRECT_URL']."<br />"
print 
"_SERVER['PHP_SELF'] =".$_SERVER['PHP_SELF']."<br />"
print 
"_SERVER['SCRIPT_NAME'] =".$_SERVER['SCRIPT_NAME']."<br />"
print 
"PHP_SELF =".$PHP_SELF ."<br />"
?>


I had the same problem that I (think) solved by replacing
$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
with
$HTTP_SERVER_VARS['SCRIPT_NAME'];

I don't know if that won't cause some other problems but for now, it works...

whazzup

yoo! did that.. reply when executed in root:

HTTP_SERVER_VARS['SCRIPT_NAME'] =/test.php
HTTP_SERVER_VARS['REDIRECT_URL'] =/test.php
_SERVER['PHP_SELF'] =/test.php
_SERVER['SCRIPT_NAME'] =/test.php
PHP_SELF =/test.php

but.. when executed in subdirectory fotoalbum (thought that would give you some more info...)

HTTP_SERVER_VARS['SCRIPT_NAME'] =/test.php
HTTP_SERVER_VARS['REDIRECT_URL'] =/test.php
_SERVER['PHP_SELF'] =/fotoalbum/test.php
_SERVER['SCRIPT_NAME'] =/test.php
PHP_SELF =/fotoalbum/test.php

Only 'php_self' returns with a path...
Smile. Tomorrow will be worse

Joachim Müller

then $_SERVER['SCRIPT_NAME'] is the var to go for!

GauGau

whazzup

I will, I will go for it... Ahum. How?? Can you please tell me what to do with it... Or not to do with it... Running a script is somewhat different than understanding and editing..

tnx
Smile. Tomorrow will be worse

Joachim Müller

in include/init.inc.php, search for
Quote// Initialise the $CONFIG array and some other variables
$CONFIG = array();
$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
$REFERER = urlencode($PHP_SELF . (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING'] ? '?' . $HTTP_SERVER_VARS['QUERY_STRING'] : ''));
$ALBUM_SET = '';
$FORBIDDEN_SET = '';
$CURRENT_CAT_NAME = '';
$CAT_LIST = '';
and replace it with
Quote// Initialise the $CONFIG array and some other variables
$CONFIG = array();
$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $_SERVER['SCRIPT_NAME'];
$REFERER = urlencode($PHP_SELF . (isset($HTTP_SERVER_VARS['QUERY_STRING']) && $HTTP_SERVER_VARS['QUERY_STRING'] ? '?' . $HTTP_SERVER_VARS['QUERY_STRING'] : ''));
$ALBUM_SET = '';
$FORBIDDEN_SET = '';
$CURRENT_CAT_NAME = '';
$CAT_LIST = '';
GauGau

whazzup

Titooy... i tried it and (believe it or not) it works now... I don't even wamma know why but gratefull. Thanks for all the help guys!
Smile. Tomorrow will be worse

neo441

Dear all,

I followed your thread very carefuly since it seems that i have the same problem i am also hosted by lycos.
So to check again my Global variable I run also ths test.php
in the root
HTTP_SERVER_VARS['SCRIPT_NAME'] =/test.php
HTTP_SERVER_VARS['REDIRECT_URL'] =/test.php
_SERVER['PHP_SELF'] =/test.php
_SERVER['SCRIPT_NAME'] =/test.php
PHP_SELF =/test.php
and in copermine
HTTP_SERVER_VARS['SCRIPT_NAME'] =/test.php
HTTP_SERVER_VARS['REDIRECT_URL'] =/test.php
_SERVER['PHP_SELF'] =/coppermine/test.php
_SERVER['SCRIPT_NAME'] =/test.php
PHP_SELF =/coppermine/test.php

So same cause same solution right
I change config.php and int.inc.php

but unfortunaely i am stil stuck because when i try to save my config (using coppermine/config.php) is sill searching for /config.php which doesn't exist..
Please help
Thanks

Joachim Müller

are you actually using cpg1.2.x?

Joachim

neo441

Hi Joachim,

Thanks for your quick reply !
Actually, I use cpg1.3.2.

Am i in the wrong thread  ???

Nary