Srweb Smarty configuration

13 views
Skip to first unread message

Laurenz

unread,
Nov 20, 2015, 5:26:17 PM11/20/15
to Student Robotics Development
Hi,

I installed srweb from git on a fresh Ubuntu 14.04 VM (yes, again ;P). After following the INSTALL instructions I got a 500 Server Error.

error.log:
> PHP Fatal error:  require(): Failed opening required '/usr/share/php/Smarty//Smarty.class.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/laurenz/dev/sr/srweb/index.php on line 9

The erroneous index.php line reads
> require(SMARTY_DIR . '/Smarty.class.php');

SMARTY_DIR is set in config.inc.php:
> /* The directory 'Smarty.class.php' can be found in */
> default_define('SMARTY_DIR', '/usr/share/php/Smarty/');

However, on my system Smarty lives in /usr/share/php/smarty3. (I installed smarty via sudo apt-get install smarty)

A symbolic link from /usr/share/php/Smarty to /usr/share/php/smarty3 resolved the issue. Everything works as expected now.

I'm not sure why I have a different Smarty directory. Possibly this could be checked in the php config file? Or maybe add a hint in the INSTALL file?

Cheers
Laurenz

Peter Law

unread,
Nov 20, 2015, 5:42:41 PM11/20/15
to srobo...@googlegroups.com
Laurenz wrote:
> I installed srweb from git on a fresh Ubuntu 14.04 VM (yes, again ;P). After
> following the INSTALL instructions I got a 500 Server Error.
...
> SMARTY_DIR is set in config.inc.php:
>> /* The directory 'Smarty.class.php' can be found in */
>> default_define('SMARTY_DIR', '/usr/share/php/Smarty/');
>
> However, on my system Smarty lives in /usr/share/php/smarty3. (I installed
> smarty via sudo apt-get install smarty)

This is unsurprising -- different distros are inevitably going to
install things in slightly different places.

The expected solution is to override the values within the config file
using the optional "local.config.inc.php" file. All you need to do is
create this file with some defines in it and srweb will honour those
before the values in the main "config.inc.php" file.

> I'm not sure why I have a different Smarty directory. Possibly this could be
> checked in the php config file? Or maybe add a hint in the INSTALL file?

I'd guess that the default value is correct on Fedora systems, but not
Ubuntu. Please do submit patches against the INSTALL and/or config
files if you think things can be improved.

Thanks,
Peter
Reply all
Reply to author
Forward
0 new messages