websvnphp / websvn

Fork from WebSVN
https://websvnphp.github.io/
GNU General Public License v2.0
134 stars 31 forks source link

2.7.0 unable to load $config->parentPath('/home/svn/repos') #161

Closed AlecMBurton closed 1 year ago

AlecMBurton commented 2 years ago

I'm trying to upgrade a system that is using websvn 2.3.1 and subversion 1.6.1. I've just got a fresh install of Debian 11.

I've got everything set up, I believe... However when I set the $config->parentPath('/home/svn/repos'); If I go back and reload the page I get the error:

Please set up a repository in include/config.php using $config->parentPath or $config->addRepository. See the installation guide for more details.

Any help is much appreciated.

michael-o commented 2 years ago

Upgrade to a supported Subversion version: 1.10+

AlecMBurton commented 2 years ago

Sorry, I should have clarified. The new system is running WebSVN 2.7.0 and Apache Subversion 1.14.1

ams-tschoening commented 2 years ago

If I go back and reload the page I get the error:

Is going back using the browser history really necessary or does the error happen when simply reloading a formerly working page as well? How do the URLs like like when the problem happens? Are you using some kind of persistent PHP environment, keeping state between different request, and possibly influencing things like current directories? What about multiviews?

https://github.com/websvnphp/websvn/blob/b922c18d36f12b226c2e98e5c06ae749360d9458/include/setup.php#L424

AlecMBurton commented 2 years ago

Is going back using the browser history really necessary or does the error happen when simply reloading a formerly working page as well?

I'm starting from the ground up with this install aside from the parent directory that I'm trying to use... I'll try to be as verbose as possible..

How do the URLs like like when the problem happens? They don't seem to change when the error happens...

http://172.22.3.56/websvn/

Are you using some kind of persistent PHP environment, keeping state between different request, and possibly influencing things like current directories? What about multiviews? I don't know if I'm using persistent environment or not, I'm sorry. I do not believe that I'm using multiviews..

drwxrws--- 15 www-data subversion 4096 Mar 15 14:37 repos

This is the parent directory that I want to use. I copied the directory permissions and user:group from the previous "working" setup. i.e The previous working setup is Debian 6.0 running WebSVN 2.3.1 and subversion 1.6.1.

Inside the repos directory is: drwxrws--- 7 www-data www-data 4096 Mar 15 14:37 3DModels

I'm trying to make the config as simple as possible. I'm using a static config.php and the contents are:

$config->parentPath("/home/svn/repos");                          
$config->setEnscriptPath("/usr/bin");                            
$config->setSedPath("/bin");                                     
$config->useEnscript();                                          

$config->addTemplatePath($locwebsvnreal.'/templates/calm/');     
$config->addTemplatePath($locwebsvnreal.'/templates/BlueGrey/'); 
$config->addTemplatePath($locwebsvnreal.'/templates/Elegant/');  

// $config->useMultiViews();                                     

$config->useAuthenticationFile('/home/svn/access');              
$config->addInlineMimeType('text/plain');                        
$config->setMinDownloadLevel(2);                                 

set_time_limit(0);                                               
$config->expandTabsBy(8);                                        
?>

In apache I have conf-enabled websvn.conf:


Alias /websvn /usr/share/websvn

<Directory /usr/share/websvn>
  DirectoryIndex index.php
  Options FollowSymLinks
  Order allow,deny
  Allow from all
  <IfModule mod_php4.c>
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
  </IfModule>
</Directory>

and sites-enabled of:

        ServerAdmin networkadmin@phytec.com
        ServerName svn.phytec.com
        DocumentRoot /var/www/websvn

        <Location />
                Options FollowSymLinks

                Include /etc/apache2/pam_flux_authn

                <IfModule mod_php4.c>
                        php_flag magic_quotes_gpc Off
                        php_flag track_vars On
                </IfModule>
        </Location>

        RedirectMatch ^(/repos)$ /repos/
        <Location /repos/>
                DAV svn

                ## use this access file for authorizing SVN users.
                ## websvn is configured to use this file too in /etc/websvn.conf.
                AuthzSVNAccessFile /home/svn/access

                ## Disable path-based authz checks to reduce server load.
                ## Repository-level authz still works.
                SVNPathAuthz off

                SVNParentPath /home/svn/repos
                SVNListParentPath on
        </Location>
</VirtualHost>

I'm not sure what's going wrong to cause this issue. I'm thankful for all your help.

ams-tschoening commented 2 years ago

This looks strange:

<IfModule mod_php4.c>

Support for PHP4 doesn't make too much sense in somewhat current setups anymore, WebSVN wouldn't work with it anyway. You need to check which version of PHP is really used in your setup, how it is loaded etc. Have another look at conf-enabled for files like php7.2-cgi.conf. Of course things might be configured totally different, things look like the following on my Windows:

LoadModule  php7_module   "C:/Program Files/PHP/Current TS/php7apache2_4.dll"
PHPIniDir                 "C:/Program Files/PHP/Current TS"

Additionally have a look at which MPM module your HTTPd uses, you can find this in mods-enabled, using files like e.g. mpm_worker.load. Different worker approaches have different implications regarding current directories, when things are reloaded per request if at all etc. At least this is where I would focus on, because PHPs include takes current directories into account:

Files are included based on the file path given or, if none is given, the include_path specified. If the file isn't found in the include_path, include will finally check in the calling script's own directory and the current working directory before failing.

https://www.php.net/manual/en/function.include.php

michael-o commented 2 years ago

Is this resolved?

michael-o commented 1 year ago

Still waiting for an answer...

michael-o commented 1 year ago

No response.