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]   Go Down

Author Topic: How to istall in pointer domain?  (Read 4296 times)

0 Members and 1 Guest are viewing this topic.

yannisc

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
How to istall in pointer domain?
« on: April 03, 2005, 11:23:44 am »

Hi!

I downloaded and trying to install coppermine in fatsakarta.com which is a pointer (netfirms server) to greektechforum.com/fatsakarta

When I login through greektechforum.com/fatsakarta everything is ok, but I want the users to only see fatsakarta.com.

The problem is when I log in from fatsakarta.com a lot of links don't work:

For example the next picture button links to: http://fatsakarta///displayimage.php?album=lastup&cat=0&pos=4

Or when I try to save the settings from the config, it gets a DNS error and tries to here: http://fatsakarta///config.php

Is there a solution?

thanks a lot,
Yannis
Logged

Nibbler

  • Guest
Re: How to istall in pointer domain?
« Reply #1 on: April 03, 2005, 03:44:26 pm »

Look in init.inc.php for the part where $PHP_SELF is defined and find some variation of server vars that give you the correct info.
Logged

yannisc

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: How to istall in pointer domain?
« Reply #2 on: April 03, 2005, 04:52:42 pm »

Like what variations?

I'm not that advanced... could you give me a hint?
Logged

Nibbler

  • Guest
Re: How to istall in pointer domain?
« Reply #3 on: April 03, 2005, 05:03:04 pm »

You need to look through your phpinfo in the $_SERVER section, find one that matches your current path, and set your $PHP_SELF to it in init.inc.php. If this is beyond you, you can pm me an FTP login to your site and I can do it for you.
Logged

colorblind

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: How to istall in pointer domain?
« Reply #4 on: May 13, 2005, 10:04:22 pm »

This is the only thread I have found concerning this issue.  I am having a similar problem.

I have two domain names in the same webspace, call them "www.maindomain.com" and "www.seconddomain.com".  The second domain name points to a folder in my root directory, call it "folder1".  So the secondary domain name points to "htp://www.maindomain.com/folder1" so that "htp://www.seconddomain.com" shows in the address bar.  I am trying to install coppermine to this folder ("folder1") so that visitors to my gallery will see "www.seconddomain.com" in their address bar.  This creates some filepath problems, similar to the OP's.

If I access my gallery using www.maindomain.com, everything works great.  If I access the gallery using the second domain name, I receive errors when I do things such as try to register, login, change the config, etc.  I have looked at my phpinfo, and many of the settings under $_SERVER are broken.  For instance, when using the main domain name (example: htp://www.maindomain.com/folder1/gallery/phpinfo.php), $PHP_SELF is "/folder1/gallery/phpinfo.php" and all is well. 

If I look at phpinfo through the second domain (htp://www.seconddomain.com/gallery/phpinfo.php"), then $PHP_SELF is "//folder1///gallery/phpinfo.php" and I get the errors.  Settings such as _SERVER["SCRIPT_URI"]   look like "http://www.seconddomain.com//folder1///gallery/phpinfo.php" which is even worse.

Nibbler says I need to change $PHP_SELF in the init.inc.php file, but from reading this thread I am not sure exaclty what part of the code needs to be changed, or exactly what to change it to, or if this is the only thing that I need to change.  Help would be appreciated.  If there is no solution to this problem, please let me know so I can look at alternatives.

Thank you for reading.
Logged

Nibbler

  • Guest
Re: How to istall in pointer domain?
« Reply #5 on: May 14, 2005, 05:13:53 pm »

Find the line

Code: [Select]
$PHP_SELF = isset($HTTP_SERVER_VARS['REDIRECT_URL']) ? $HTTP_SERVER_VARS['REDIRECT_URL'] : $HTTP_SERVER_VARS['SCRIPT_NAME'];

in your init.inc.php, and try this new code instead:
Code: [Select]
$PHP_SELF = '';
$possibilities = array('REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL', 'SCRIPT_NAME','SCRIPT_FILENAME');
foreach ($possibilities as $test){
if (isset($_SERVER[$test]) && preg_match('/([^\/]+\.php)$/', $_SERVER[$test], $matches)){
$PHP_SELF = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $matches[1];
break;
}
}

Logged

colorblind

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Re: How to istall in pointer domain?
« Reply #6 on: May 16, 2005, 09:20:13 pm »

That seems to fix the problem.  Any chance I could get you to explain what the new code does exactly?  In any case, thank you for your help - I appreciate it.
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 16 queries.