SPX-GC icon indicating copy to clipboard operation
SPX-GC copied to clipboard

Setting up fusion directory from source worked for 1.3 but not 1.4 or 1.5

Open pravi opened this issue 9 months ago • 1 comments

Describe the bug Unable to install fusiondirectory 1.4 or 1.5 using fusionforge git repo, php-fpm and nginx. Same setup worked for fusiondirectory 1.3 (though fusiondirctory debian package was already installed on the system, so it might have performed the required steps)

To Reproduce Steps to reproduce the behavior:

  1. Download fusiondirectory 1.4.tar.gz to /srv/fusiondirectory on a freshly installed debian bullseye system
  2. Install php-fpm and nginx.
  3. configure nginx
  4. Visit the url

Fatal error: require(): Failed opening required '/usr/share/php/smarty3/Smarty.class.php' (include_path='.:/srv/fusiondirectory/include:/usr/share/php:/usr/share/php') in /srv/fusiondirectory/include/php_setup.inc on line 349 Expected behavior It should show the setup screen. Or a list of required dependencies should be documented. If I managed to get this working, I'd be happy to add these steps to the documentation.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • PHP: [ php 5.6 ]
  • PHP provenance: [original Debian]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

nginx configuration

root /srv/fusiondirectory/html;
index index.php index.html index.htm

location ~ \.php$ {
                include snippets/fastcgi-php.conf;
                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
}

apt-file find Smarty.class.php

civicrm-common: /usr/share/civicrm/packages/Smarty/Smarty.class.php smarty3: /usr/share/php/smarty3/Smarty.class.php

apt install smarty3

After smarty3 is installed, the error changes to

Fatal error: require_once(): Failed opening required '/var/cache/fusiondirectory//class.cache' (include_path='.:/srv/fusiondirectory/include:/usr/share/php:/usr/share/php') in /srv/fusiondirectory/include/functions.inc on line 31

Please document how to generate this file.

I downloaded https://github.com/fusiondirectory/fusiondirectory-tools/archive/refs/tags/1.2.tar.gz and fusiondirectory-integrator 1.2

Extract and copy src directory from these to /usr/share/php/FusionDirectory and set PATH variable to include bin directory from fusiondirectory-tools.

# cp -r fusiondirectory-integrator-1.2/src/* /usr/share/php/FusionDirectory
# cp -r fusiondirectory-tools-1.2/src/* /usr/share/php/FusionDirectory

# export PATH=/srv/fusiondirectory-tools-1.2/bin:$PATH fusiondirectory-configuration-manager --check-directories

and create the required directories

# fusiondirectory-configuration-manager --update-cache
# Update class.cache file

Now if we visit the page, it says Uncaught Error: Class 'session' not found

Tried adding

fastcgi_param PHP_VALUE "include_path=/srv/fusiondirectory/include";

to nginx configuration

# systemctl restart php7.4-fpm nginx

/srv/fusiondirectory/include/class_session.inc is present in the path

Also added include_path="/srv/fusiondirectory/include:/usr/share/php" in /etc/php/7.4/fpm/php.ini

But this has no effect,

Then I added

require_once("../include/class_logging.inc");
require_once("../include/class_session.inc");

to html/setup.php

and visited http://157.180.79.194/setup.php - this site is now live and accessible

Adding

require_once("../include/simpleplugin/class_simplePlugin.inc");

changes the error to

Fatal error: cannot instantiate class 'SimpleTab' - try running 'fusiondirectory-configuration-manager --update-cache' to fix this

But adding this does not help fix the error

adding

require_once("../include/simpleplugin/class_simpleTabs.inc"); require_once("../include/simpleplugin/interface_SimpleTab.inc");

does not fix this. Am I missing any steps here? I was following the advice on the gosa issue https://github.com/gosa-project/gosa-core/issues/66 that you can install it like any other app from source.

pravi avatar Mar 28 '25 15:03 pravi

Same error when replacing nginx with apache2 as well Fatal error: cannot instantiate class 'SimpleTab' - try running 'fusiondirectory-configuration-manager --update-cache' to fix this

pravi avatar Mar 28 '25 17:03 pravi