Menu

"Page: (...) not found!" error

Help
2004-09-23
2013-04-08
  • Nobody/Anonymous

    Just installed the gallery software and modified files, etc as per the installation instructions.

    When I go to http://domain.com/photo/image.jpg, I get the following error (note the double forward-slashes):

    Page: //path/to/domain.com/photo//photo/image.jpg not found!
    [ admin ]
    Indexed by phpAutoGallery v0.9.6
    Copyright  2003, 2004 Martin Theimer

    My .htaccess file looks as such:

    RewriteEngine on
    RewriteBase /photo/
    RewriteCond %{REQUEST_URI} !.*__phpAutoGallery/wrapper\.php.*
    RewriteRule .* /photo/__phpAutoGallery/wrapper.php [NE,QSA,L]

    This is running on Solaris8, apache1.3.31, php5.0.1 w/safe_mode turned off.  I'm not seeing anything in the server logs unfortunately and am inept at php for the most part unfortunately :/

    Any idears?

    Thx :)

     
    • Anonymous

      Anonymous - 2004-09-23

      issue the command
      grep -R "CGI" *
      and alter all the resulting files:

      look for
              // get informations about where and who i am
              if (isset($HTTP_SERVER_VARS['SCRIPT_URL']) && $HTTP_SERVER_VARS['SCRIPT_URL'] != $HTTP_SERVER_VARS['SCRIPT_NAME']) {
                      // CGI
                      $filesystem_root_path = str_replace($HTTP_SERVER_VARS['SCRIPT_URL'], "/", $HTTP_SERVER_VARS['SCRIPT_FILENAME']);
              }
              else {
                      // APACHE
                      $filesystem_root_path = str_replace($HTTP_SERVER_VARS['SCRIPT_NAME'], "/", $HTTP_SERVER_VARS['SCRIPT_FILENAME']);
              }

      and remove the wohle block, yust leave the line

                      $filesystem_root_path = str_replace($HTTP_SERVER_VARS['SCRIPT_NAME'], "/", $HTTP_SERVER_VARS['SCRIPT_FILENAME']);

      Seems that newer versions of php/apache don't need any special handling more.

      chris

       
      • Nobody/Anonymous

        Made the suggested changes (wrapper.php, and most files within the loader subdir).

        So far no changes.  I'm trying to play around a bit with the substring matching to see if I can get it pinned down to something, but if anyone has further suggestions i'd be happy to try :)

        Thanks for the help chris!

         
    • Nobody/Anonymous

      BTW, the changes outlined in the below thread (namely using realpath) fixed my problem:

      http://sourceforge.net/forum/forum.php?thread_id=1118711&forum_id=325021

      Gotta love forums :)

       
    • Peter Valdemar Mørch

      I ran into the same problem(s) - there are two:
      1) Distinguishing between CGI and apche in newer apaches doesn't work properly
      2) softlinks / realpath problems.

      Here is a patch:
      http://www.morch.com/misc/phpAutoGallery/

      Peter Mrch

       
    • Nobody/Anonymous

      Hi,

      I have just installed phpAutoGallery on my family’s intranet. It took a couple of hours to get it up and running.  I run it on a windows platform with a phpDev installation (PHP4.06 / Apache1.3.20).

      When I first installed it I got “Page: /MyPic not found!” error/message. I tried al of the suggestions in this forum to get it up and running but nothing solved my problem.

      I then started to analyze the code and found out that I hade problem with the “str_replace” in wrapper.php. What I found out was this:

      In the code part

      else {
              // APACHE
              $filesystem_root_path = str_replace($HTTP_SERVER_VARS['SCRIPT_NAME'], "/", $HTTP_SERVER_VARS['SCRIPT_FILENAME']);

      I found out that I hade problems with capital letters. When I tested the different parts in the “str_replace” function I got this result.

      echo ($HTTP_SERVER_VARS['SCRIPT_NAME'] . "<br>\n"); resulted in this string  /MyPic/__phpAutoGallery/wrapper.php

      and

      echo ($HTTP_SERVER_VARS['SCRIPT_FILENAME'] . "<br>\n"); resulted in this string c:/phpdev/www/mypic/__phpautogallery/wrapper.php

      When I then checked the result of &#8220;str_replace&#8221; in the &#8220;$filesystem_root_path&#8221; variable I found out that it where
         c:/phpdev/www/mypic/__phpautogallery/wrapper.php
      instead of
         c:/phpdev/www/

      The &#8220;str_replace&#8221; function wasn&#8217;t able to match the /MyPic/__phpAutoGallery/wrapper.php part with /mypic/__phpautogallery/wrapper.php part.

      To solve this problem I renamed every instance of MyPic and phpAutoGallery in the code to mypic and phpautogallery. I even renamed the folders.

      After the renaming session the excellent phpAutoGallery worked as it should.

      Thanks for some great code helping me sharing all my digital photos with my family in an easy way.

       
    • Paul-Christiaan Spruijtenburg

      As stated by above user also one of the problems at least on this installation on a windows machine, is case sensitivity. That is, the case sensitivity of the str_replace.
      $HTTP_SERVER_VARS['SCRIPT_NAME'] is case-sensitive it appears while $HTTP_SERVER_VARS['SCRIPT_FILENAME'] is all lower-case. Therefore preventing any match-up of the two and yielding a reliable root path.

      I am now running the gallery with a replacment string replacement function. Works fine however using any form of upper-case in the url-path results in a "not-found" because SCRIPT_FILENAME is all lower-case.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.