running perl script with zenphoto.

OK, I am at a loss here and so far cannot figure it out, it might be related to the rewrite functions but I am not sure.

Currently running the 12/22 build.

I cannot also recall if it was the 12/18 or earlier build in which everything was fine, but now I am having issues with running our perl script.

The script resides within the sites cgi-bin directory and a sub-folder of that, so for example /cgi-bin/myscript/runthis.cgi. The script is basically a shopping cart system that works like a form processor with templates and the like....

Now as I said this was working fine before but now it is saying an error 404 as not being a ZP object, well of course not that is because it is not one, it is trying to make /cgi-bin/myscript an album of which it is not of course.

Was something changed, is there something I can change or do to test or get my script running again?

Cheers

GW

Comments

  • acrylian Administrator, Developer
    All we did change was adding rewrite rules for the now gone root rss and sitemap files so they should still work but those have been there for some time in the nightly now.
  • The 404 error will be because somehow Zenphoto thinks the link is to one of its items. The .htaccess is supposed to check for existence of the target and allow it unmodified if it exists. Roughly the equivalent of `if file_exists(cgi-script) return cgi-script; else return link to zp object based on the text of cgi-script;`

    So maybe the script is missing or perhaps the file permissions have changed so that the test fails?

    Looking at the .htaccess changes for RSS it would appear that they were placed in the wrong position. They are before the generic file check, so could be causing the problem.

    Try moving the lines
    `
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^albums/?(.+/?)?$ $1 [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [L]
    `
    Up to the front.
  • That did not fix it.

    I have tried various things to no avail, the perl scripts are being treated like albums. Permissions are correct and are know to be working as I have tested on their own on a different site.

    Any other ideas?

    Thanks

    GW
  • Do things work without the .htaccess and with mod_rewrite reset?
  • Bigger <redface>... just not my day... I had a bloody comma in the wrong spot of my perl conf file and it was the reason for the error, not ZP, sorry to annoy you on this one.

    Cheers for your help

    GW
  • EDIT:

    Our posts crossed in the ether. But maybe this information will help someone else, so I will leave it here.
    *************************************

    BTW, here is the English interpretation of the rewrite rules as they should be:

    `

    RewriteEngine On

    RewriteBase /Zenphoto
    `
    sets rewrite active with a base folder of the install folder

    `RewriteRule ^admin/?$ zp-core/admin.php [R,L]`

    redirects to the admin pages for a simple "admin" link

    `
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^albums/?(.+/?)?$ $1 [R=301,L]
    `
    if the request is a directory on the server, treat it as an album folder

    `
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [L]
    `
    id the request is a file that exists on the server or it is a folder that exists on the server[sic] load that request

    `##### put no rules before this line #######`

    So, if the request is for a script file that last test should be aborting the rewrite rules and directly loading the script. If it is not, I do not know why. You might try setting the `DEBUG_404` define to true and see what the debug log tells you.
Sign In or Register to comment.