Advanced search  

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]

Pages: [1] 2   Go Down

Author Topic: base directory problem  (Read 22391 times)

0 Members and 1 Guest are viewing this topic.

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
base directory problem
« on: December 28, 2003, 02:35:57 pm »

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!
Logged
Smile. Tomorrow will be worse

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
base directory problem
« Reply #1 on: December 28, 2003, 06:37:30 pm »

edit config.php, find
Code: [Select]
<form action="$PHP_SELF" method="post">and change it to
Code: [Select]
<form action="config.php" method="post">
GauGau
Logged

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
config works.. but...
« Reply #2 on: December 28, 2003, 07:47:38 pm »

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.
Logged
Smile. Tomorrow will be worse

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
base directory problem
« Reply #3 on: December 29, 2003, 09:36:41 am »

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
Logged

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
base directory problem
« Reply #4 on: December 29, 2003, 02:02:47 pm »

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.
Logged
Smile. Tomorrow will be worse

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
base directory problem
« Reply #5 on: December 29, 2003, 06:05:12 pm »

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
Logged

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
base directory problem
« Reply #6 on: December 29, 2003, 09:01:45 pm »

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!
Logged
Smile. Tomorrow will be worse

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
base directory problem
« Reply #7 on: December 29, 2003, 11:28:58 pm »

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
Logged

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
base directory problem
« Reply #8 on: December 30, 2003, 12:01:43 am »

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()).
Logged
Smile. Tomorrow will be worse

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
base directory problem
« Reply #9 on: December 30, 2003, 08:30:08 am »

oh yeah, the benefits of free webhosting :wink: . Try printing the required vars with a script, like this:
Code: [Select]
<?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
Logged

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
base directory problem
« Reply #10 on: December 30, 2003, 08:39:35 pm »

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
Logged
Smile. Tomorrow will be worse

Titooy

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 736
    • under construction...
base directory problem
« Reply #11 on: December 30, 2003, 08:58:09 pm »

Remove the first $'s
Code: [Select]
<?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
Code: [Select]
$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];
with
Code: [Select]
$HTTP_SERVER_VARS['SCRIPT_NAME'];

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

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
base directory problem
« Reply #12 on: December 30, 2003, 09:44:21 pm »

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...
Logged
Smile. Tomorrow will be worse

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
base directory problem
« Reply #13 on: December 31, 2003, 10:24:30 am »

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

GauGau
Logged

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
base directory problem
« Reply #14 on: December 31, 2003, 11:53:48 am »

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
Logged
Smile. Tomorrow will be worse

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
base directory problem
« Reply #15 on: December 31, 2003, 12:12:50 pm »

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
Logged

whazzup

  • Coppermine newbie
  • Offline Offline
  • Posts: 9
    • http://www.defakkel.com
base directory problem
« Reply #16 on: January 02, 2004, 01:55:04 am »

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!
Logged
Smile. Tomorrow will be worse

neo441

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: base directory problem
« Reply #17 on: February 28, 2005, 05:57:46 pm »

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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: base directory problem
« Reply #18 on: February 28, 2005, 06:56:59 pm »

are you actually using cpg1.2.x?

Joachim
Logged

neo441

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: base directory problem
« Reply #19 on: February 28, 2005, 07:02:02 pm »

Hi Joachim,

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

Am i in the wrong thread  ???

Nary
Logged
Pages: [1] 2   Go Up
 

Page created in 0.025 seconds with 18 queries.