Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install failing: FATAL ERROR Uncaught Error: Class "Smarty" not found ..... #163

Open
daj1u06 opened this issue Jan 12, 2023 · 9 comments
Open

Comments

@daj1u06
Copy link

daj1u06 commented Jan 12, 2023

Hi, firstly thank you for trying to keep this brilliant resource going.
I've been running multiple instances of booked 2.7.2 on xampp 7.2.10 on win 7 but am being forced to move to win10 on another PC. I've used latest xampp 8.2.0 and latest Librebooking.
When I point to \Web\install to initiate the installation, I get a fatal error.

Fatal error: Uncaught Error: Class "Smarty" not found in C:\xampp\htdocs\BIUbooked\lib\Email\SmartyEmail.php:9 Stack trace: #0 C:\xampp\htdocs\BIUbooked\lib\Email\namespace.php(7): require_once() #1 C:\xampp\htdocs\BIUbooked\lib\Email\Messages\AccountCreationEmail.php(3): require_once('C:\xampp\htdocs...') #2 C:\xampp\htdocs\BIUbooked\Domain\Access\UserRepository.php(7): require_once('C:\xampp\htdocs...') #3 C:\xampp\htdocs\BIUbooked\Domain\Access\namespace.php(13): require_once('C:\xampp\htdocs...') #4 C:\xampp\htdocs\BIUbooked\lib\Common\Validators\TermsOfServiceValidator.php(3): require_once('C:\xampp\htdocs...') #5 C:\xampp\htdocs\BIUbooked\lib\Common\Validators\namespace.php(20): require_once('C:\xampp\htdocs...') #6 C:\xampp\htdocs\BIUbooked\lib\Common\SmartyPage.php(8): require_once('C:\xampp\htdocs...') #7 C:\xampp\htdocs\BIUbooked\lib\Common\namespace.php(5): require_once('C:\xampp\htdocs...') #8 C:\xampp\htdocs\BIUbooked\Pages\Page.php(10): require_once('C:\xampp\htdocs...') #9 C:\xampp\htdocs\BIUbooked\Pages\Install\InstallPage.php(3): require_once('C:\xampp\htdocs...') #10 C:\xampp\htdocs\BIUbooked\Web\install\index.php(10): require_once('C:\xampp\htdocs...') #11 {main} thrown in C:\xampp\htdocs\BIUbooked\lib\Email\SmartyEmail.php on line 9

I can't find anything relating to this online.

As per installation instructions, I've followed my notes for my existing installation and I've set config.php with
$conf['settings']['script.url'] = '152.78.6.222:8080/BIUbooked/Web';
(I will have multiple, separate instances of LibreBooking running under one xampp from separate subdirectories in htdocs)
and SYSTEM has full control of tpl and tpl_c folders in C:\xampp\htdocs\BIUbooked

I would be very grateful for any suggestions as this has me stumped. Could it be a PHP issue with PHP 8.2 and I need to revert to xampp 7.2.10?

Many thanks

DAJ

@effgarces
Copy link
Collaborator

As part of the effort to update librebooking to PHP 8, and also to make it more modern, the smarty template engine was removed and should now be added using composer, just do a composer install on the folder and it will download the latest/correct version and librebooking should be up and running

@daj1u06
Copy link
Author

daj1u06 commented Jan 13, 2023

Thank you so much, I'll give it a go as soon as I can.

@Xalendis
Copy link

I've got the same problem and it does not help to run the composer.
Problem 1
- Root composer.json requires stripe/stripe-php ^10.2 -> satisfiable by stripe/stripe-php[v10.2.0, v10.3.0].
- stripe/stripe-php[v10.2.0, ..., v10.3.0] require ext-curl * -> it is missing from your system. Install or enable PHP's curl extension.
Problem 2
- Root composer.json requires squizlabs/php_codesniffer ^3.7.1 -> satisfiable by squizlabs/php_codesniffer[3.7.1].
- squizlabs/php_codesniffer 3.7.1 requires ext-xmlwriter * -> it is missing from your system. Install or enable PHP's xmlwriter extension.
Problem 3
- squizlabs/php_codesniffer 3.7.1 requires ext-xmlwriter * -> it is missing from your system. Install or enable PHP's xmlwriter extension.
- phpcompatibility/php-compatibility 9.3.5 requires squizlabs/php_codesniffer ^2.3 || ^3.0.2 -> satisfiable by squizlabs/php_codesniffer[3.7.1].
- Root composer.json requires phpcompatibility/php-compatibility ^9.3.5 -> satisfiable by phpcompatibility/php-compatibility[9.3.5].

To enable extensions, verify that they are enabled in your .ini files:
- /etc/php/8.2/cli/php.ini
- /etc/php/8.2/cli/conf.d/10-mysqlnd.ini
- /etc/php/8.2/cli/conf.d/10-opcache.ini
- /etc/php/8.2/cli/conf.d/10-pdo.ini
- /etc/php/8.2/cli/conf.d/20-bz2.ini
- /etc/php/8.2/cli/conf.d/20-calendar.ini
- /etc/php/8.2/cli/conf.d/20-ctype.ini
- /etc/php/8.2/cli/conf.d/20-exif.ini
- /etc/php/8.2/cli/conf.d/20-ffi.ini
- /etc/php/8.2/cli/conf.d/20-fileinfo.ini
- /etc/php/8.2/cli/conf.d/20-ftp.ini
- /etc/php/8.2/cli/conf.d/20-gettext.ini
- /etc/php/8.2/cli/conf.d/20-iconv.ini
- /etc/php/8.2/cli/conf.d/20-intl.ini
- /etc/php/8.2/cli/conf.d/20-mbstring.ini
- /etc/php/8.2/cli/conf.d/20-mcrypt.ini
- /etc/php/8.2/cli/conf.d/20-mysqli.ini
- /etc/php/8.2/cli/conf.d/20-pdo_mysql.ini
- /etc/php/8.2/cli/conf.d/20-phar.ini
- /etc/php/8.2/cli/conf.d/20-posix.ini
- /etc/php/8.2/cli/conf.d/20-readline.ini
- /etc/php/8.2/cli/conf.d/20-shmop.ini
- /etc/php/8.2/cli/conf.d/20-sockets.ini
- /etc/php/8.2/cli/conf.d/20-sysvmsg.ini
- /etc/php/8.2/cli/conf.d/20-sysvsem.ini
- /etc/php/8.2/cli/conf.d/20-sysvshm.ini
- /etc/php/8.2/cli/conf.d/20-tokenizer.ini
- /etc/php/8.2/cli/conf.d/20-zip.ini
You can also run php --ini in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with --ignore-platform-req=ext-curl --ignore-platform-req=ext-xmlwriter --ignore-platform-req=ext-xmlwriter to temporarily ignore these required extensions.

This is the output from composer and the active module from php are as follows:

Configuration File (php.ini) Path: /etc/php/8.2/cli
Loaded Configuration File: /etc/php/8.2/cli/php.ini
Scan for additional .ini files in: /etc/php/8.2/cli/conf.d
Additional .ini files parsed: /etc/php/8.2/cli/conf.d/10-mysqlnd.ini,
/etc/php/8.2/cli/conf.d/10-opcache.ini,
/etc/php/8.2/cli/conf.d/10-pdo.ini,
/etc/php/8.2/cli/conf.d/20-bz2.ini,
/etc/php/8.2/cli/conf.d/20-calendar.ini,
/etc/php/8.2/cli/conf.d/20-ctype.ini,
/etc/php/8.2/cli/conf.d/20-exif.ini,
/etc/php/8.2/cli/conf.d/20-ffi.ini,
/etc/php/8.2/cli/conf.d/20-fileinfo.ini,
/etc/php/8.2/cli/conf.d/20-ftp.ini,
/etc/php/8.2/cli/conf.d/20-gettext.ini,
/etc/php/8.2/cli/conf.d/20-iconv.ini,
/etc/php/8.2/cli/conf.d/20-intl.ini,
/etc/php/8.2/cli/conf.d/20-mbstring.ini,
/etc/php/8.2/cli/conf.d/20-mcrypt.ini,
/etc/php/8.2/cli/conf.d/20-mysqli.ini,
/etc/php/8.2/cli/conf.d/20-pdo_mysql.ini,
/etc/php/8.2/cli/conf.d/20-phar.ini,
/etc/php/8.2/cli/conf.d/20-posix.ini,
/etc/php/8.2/cli/conf.d/20-readline.ini,
/etc/php/8.2/cli/conf.d/20-shmop.ini,
/etc/php/8.2/cli/conf.d/20-sockets.ini,
/etc/php/8.2/cli/conf.d/20-sysvmsg.ini,
/etc/php/8.2/cli/conf.d/20-sysvsem.ini,
/etc/php/8.2/cli/conf.d/20-sysvshm.ini,
/etc/php/8.2/cli/conf.d/20-tokenizer.ini,
/etc/php/8.2/cli/conf.d/20-zip.ini

@Xalendis
Copy link

I reinstalled xmlwrite and Smarty modules for php 8.2 but still the same error messages. Is there anything new that could help?

@effgarces
Copy link
Collaborator

Hi, I just took a very quick look at this.
I tested with PHP8.2 on a Debian Buster VM and Librebooking came up ok (after installing it).
First, ensure that the php-cli version that you are using is the same that the webserver is using, confirm this by going to the cli and checking the php version with php -v, after that check the webserver using phpinfo() and confirm that they are the same.
Next you need to install the dependencies mentioned by composer, if you are using debian, they should
be php8.2-curl php8.2-xmlwriter, I also had to install php8.2-mbstring.
After this run composer install again, it should run correctly and Librebooking can now be installed

@Xalendis
Copy link

Xalendis commented Feb 27, 2023

php -v
PHP 8.2.3 (cli) (built: Feb 14 2023 16:58:12) (NTS)

[PHP Modules]
bz2
calendar
Core
ctype
date
dom
exif
FFI
fileinfo
filter
ftp
gettext
hash
iconv
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
random
readline
Reflection
session
shmop
SimpleXML
sockets
sodium
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache

I installed Smarty via the composer

@effgarces
Copy link
Collaborator

Curl seems to be missing from the list of modules.

I installed Smarty via the composer
If Smarty is installed you should be able to proceed and install Librebooking

@Xalendis
Copy link

I installed curl after writing the comment and reisntalled everything via the composer but the error messages are the same.
Im going to install a fresh ubuntu server and try it again

@Xalendis
Copy link

After an complete reinstall everything works fine. I dont what the problem was, maybe because I upgraded from php7 but thanks for the help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants