Issues running setup with 1.5 [solved]

Just to share a thing that might help someone else.

I had an issue rather like this one except attempting to run Setup resulted in 403 errors. The links to run Setup ended in .php and I had mod_rewrite enabled. I think that was the issue. mysite/zp-base/setup/index.php was there and permissions set to 644, but still it would 403 on me.

Editing the url link to mysite/zp-base/setup/ worked. Then once that had run, the link at the bottom threw another 403 error as it included index.php in the url. Deleting that worked - so it was something like setup/?more-text-here

It took me a few hours to figure out. I even tried upgrading to 1.5.1 in the process, but that stuck in the 403 thing too. Now I know to delete the index.php from the url I might try again in the morning.

Happy Christmas!

Comments

  • acrylian Administrator, Developer

    Sorry, I don't understand completely. There was an issue with installing 1.5. as a fresh install because of an undefined path constant which is now fixed in 1.5.1 finally.

    You can run setup manually by either entering <your zenphoto install>/zp-core/setup.php or <your zenphoto install>/zp-core/setup/. Both works as there is a file and a folder of the same name and is actually independent of modrewrite used since these are paths.

  • I don't understand it either.

    Today I have the same 403 problem with mysite/zp-core/zp-extensions/zenpage/admin-pages.php - clicking on the News or Pages tabs from the Admin interface. The rest of the Admin interface works and the zp-extensions/zenpage/admin-pages.php file exists and has permissions 777, so should be fine. Something is trying to do something clever with the browser's file request rather than serving the actual file.

    Before I could just delete the "index.php" from the url and it would work (I upgraded to 1.5.1 this morning this way) but I guess now I will need to get to the root of the problem.

    Would it be my .htacess file?

    # htaccess file version 1.4.12;
    #   Rewrite rules are now handled by PHP code
    # See the file "zenphoto-rewrite.txt" for the actual rules
    #
    # These rules redirect everything not directly accessing a file to the Zenphoto index.php script
    #
    <IfModule mod_autoindex.c>
        IndexIgnore *
    </IfModule>
    <IfModule mod_rewrite.c>
      RewriteEngine On
    
      RewriteBase /
    
      RewriteCond %{REQUEST_URI} !(/$|\.)
      RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]
    
      RewriteCond %{REQUEST_FILENAME} -f [OR]
      RewriteCond %{REQUEST_FILENAME} -d
      RewriteRule ^.*$ - [L]
    
      RewriteRule ^.*/?$                        index.php [L,QSA]
    
    </IfModule>
    
  • So, the pattern seems to be that zp-core/somefile.php works, but zp-core/anysubfolder/somefile.php doesn't work. When somefile=index, then it can be worked around by deleting index.php from the url, and then the browser/server gets it right.

    So, now I'm staring at zenphoto-rewrite.txt and trying to understand that. But turning off mod_rewrite doesn't allow those subfolder php files to work either, but I don't know what else to look at.

  • acrylian Administrator, Developer

    Yes, that is the correct htaccess file since there have been no changes since 1.4.12.

    URLs leading to zp-core are backend URLs that don't use modrewrite in any case. So if rewritting the URLs does not work, something is not setup on your server correctly regarding modrewrite. Contact your host about that.

    Or you are on different server system other than Apache that does not support htaccess like NGINX for example. Info about that on the user guide.

    It might also be that your file/folder permissions are not setup properly (e.g. too strict to work is a common issue). You find info also on the user guide.

  • acrylian Administrator, Developer
    edited January 2019

    Is your install in a subfolder mysite/? Then the rewriteBase should be RewriteBase /mysite to get modrewrite to work. Setup would fix that actually though. But again this all has nothing to do with non-rewritten links.

  • Sponsi Member
    edited January 2019

    I am in the loop of the installation. I thought that the Github zip would work but no luck. This sucks. It just installs (updates) and then comes back to the installation first screen.

    It works on PHP 5.6 but not on 7.x. Strange.

  • acrylian Administrator, Developer
    edited January 2019

    Sorry for the problems. This would be really weird as we are running it on our own site on PHP 7.2.x and also locally. In fact we are actually working on 7.2+ only.

    Please review your error logs (meaning PHP server and ZP setup and debug log).

  • After changing from 5.6 to 7.2:

    Notice: Undefined variable: conf in /my/path/zp-core/functions-basic.php on line 1707

    Warning: array_keys() expects parameter 1 to be array, null given in /my/path/zp-core/functions-basic.php on line 1723

    Warning: Invalid argument supplied for foreach() in /my/path/zp-core/functions-basic.php on line 1724

  • acrylian Administrator, Developer
    edited January 2019

    Please take look at the config file template in zp-core/zenphoto_cfg.text. There should be a $conf['special_pages'] around line 72. https://github.com/zenphoto/zenphoto/blob/master/zp-core/zenphoto_cfg.txt If that is not existing there, you did somehow not replace zp-core properly on updating and have an outdated version.

  • It's there
    $conf['special_pages'] = array(
    'page'=> array('define'=>'PAGE', 'rewrite'=>'page'),
    'search'=> array('define'=>'SEARCH', 'rewrite'=>'PAGE/search'),
    'archive'=> array('define'=>'ARCHIVE', 'rewrite'=>'PAGE/archive'),
    'tags'=> array('define'=>'TAGS', 'rewrite'=>'SEARCH/tags'),
    'gallery'=> array('define'=>'GALLERY_INDEX','rewrite'=>'PAGE/gallery')
    );

    my file is zenphoto_cfg.txt, not text.

  • acrylian Administrator, Developer

    my file is zenphoto_cfg.txt, not text.

    That's correct, was my typo.

    But if that is there I don't understand why you get the error. That line adds that define to the actual config file if missing. Do you have those lines in the config file itself, too? I just tried and all works for me as it should in 7.2.10.

    Otherwise please re-check if there are no file/folder permission errors somewhere in the server PHP log?

    If you haven't please also try the master from Github.

  • SOlved Again! It was the permissions being too open!

    In the setup list of points it did mention having permissions set to "strict". I did a fresh install and copied things over then comparing the two, found the faulty directories and php files at 777. The working install used 755 for directories and 644 for php files.

    Next I'd better check the permissions on the index.php files - though the work ar

  • I somehow had the same problem again then came back to this thread to find I hadn't posted the reply after all - the above was a draft. I don't remember how I was going to finish that last sentence.

    Today I ran the Setup Script and set the Permissions to Relaxed and all problems evaporated.

  • acrylian Administrator, Developer

    Great, "755 for directories and 644 for php files." is what is recommended. Some hosts/servers work with stricter and some break everything.
    It's not an easy matter as on some servers thte "server user" you upload via FTP and the one that runs the scripts is not the same (should be rare these days but who know, each host is different). This also can lead to such issues.

Sign In or Register to comment.