coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: yannisc on April 03, 2005, 11:23:44 AM

Title: How to istall in pointer domain?
Post by: yannisc 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
Title: Re: How to istall in pointer domain?
Post by: Nibbler 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.
Title: Re: How to istall in pointer domain?
Post by: yannisc on April 03, 2005, 04:52:42 PM
Like what variations?

I'm not that advanced... could you give me a hint?
Title: Re: How to istall in pointer domain?
Post by: Nibbler 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.
Title: Re: How to istall in pointer domain?
Post by: colorblind 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.
Title: Re: How to istall in pointer domain?
Post by: Nibbler on May 14, 2005, 05:13:53 PM
Find the line

$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:
$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;
}
}


Title: Re: How to istall in pointer domain?
Post by: colorblind 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.