admin url contains local path

Hi

Just installed zenphoto on my windows server (running apache).

When I try logging from http://myserver/zenphoto/zp-core/admin.php it tries to redirect to http://myserver/zenphoto/C:\webroot\myserver\zenphoto\zp-core\admin.php

What do I have set incorrectly to cause this?

Thanks

Comments

  • acrylian Administrator, Developer
    You might need to set the webpaths on the `zp-data/zp-config.php` file manually.
  • I assume you mean these:

    //define('WEBPATH', '/zenphoto');
    //define('SERVERPATH', 'c:/webroot/myserver/zenphoto');

    I did uncomment each of these and try different settings for both of them (not sure which one applied) but it didn't make a difference.

    Would the settings in the .htaccess file come into play? I use a custom named version of the file and renamed the .htaccess file to match the name I use but it didn't make a diff either.

    Once I re-browse to http://myserver/zenphoto/zp-core/admin.php I'm logged in and everything works ok so it only seems to affect that one refresh.
  • acrylian Administrator, Developer
    I meant those lines. You mean the rewrite path within the htaccess file, not the file itself I assume?
  • No, I DO mean the file itself. I changed the name '.htaccess' to something else unique for other reasons years ago. The RewriteBase /zenphoto directive in the file itself is correct so I didn't have to adjust that.

    I see this in the source of the admin.php page before I log in:

    ``

    In all other cases after I'm logged in the paths are /zenphoto/something ... only in this case is it showing a local path rather than a URL. Where does it get this from?
  • So, what version of Zenphoto? (Always helps to read the forum rules before asking for help. That you know what information we need to be able to help you.)
  • I've downloaded and installed zenphoto 1.2.7 just two days ago. It's running on Windows XP with Apache 2.0.63 and PHP 5.2.11.
  • acrylian Administrator, Developer
    Well, the `.htaccess` file MUST be named `.htaccess`, otherwise it does not work. Perhaps your server does not support modrewrite functionality.
  • The mod_rewrite IS working as things are now: for instance when I browse to http://myserver/zenphoto/admin I am redirected to http://myserver/zenphoto/zp-core/admin.php. It's only the redirect path within the output of the admin.php itself which is being created incorrectly. Is mod_rewrite used for that?

    Is there an issue with zenphoto being in a directory a couple up from the root? I.e. I have it in c:\webroot\myserver\zenphoto.
  • acrylian Administrator, Developer
    Actually zenphoto can run either in the root or a folder. I see no reason why not from a folder within a folder but the htaccess file needs to reflect that of course.
  • ADMIN does not use mod_rewrite for any of its URLs.

    find the function `currentRelativeURL` in admin-functions.php and change it so it reads:

    `
    function currentRelativeURL($source) {
    $source = str_replace('\\','/',$source);
    $source = str_replace(SERVERPATH, '', $source);
    $q = '';
    if (!empty($_GET)) {
    foreach ($_GET as $parm=>$value) {
    $q .= $parm.'='.$value.'&';
    }
    $q = '?'.substr($q,0,-1);
    }
    return pathurlencode($source.$q);
    }
    `
    I suspect this will fix the problem, but I do not have a Windows server, so cannot confirm.
  • That appears to have fixed it! I'll keep trying to stuff to make sure it doesn't affect something else.

    Thanks.
Sign In or Register to comment.