Jump to content

[SOLVED] Failed opening required '/tools/smarty/Smarty.class.php' - PS 1.2.0.7 beta


Recommended Posts

Hello guys,

I'm very excited with this E-commerce solutio, but I'm a begineer, and I got stuck after completing installation of PS 1.2.0.7 beta. I'm receiving the following error message in IE and Firefox:

Warning: require_once(/tools/smarty/Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in E:\Websites\XYZ\config\smarty.config.inc.php on line 3

Fatal error: require_once() [function.require]: Failed opening required '/tools/smarty/Smarty.class.php' (include_path='.;c:\php\includes') in E:\Websites\XYZ\config\smarty.config.inc.php on line 3

I'm trying to run this application in my own dedicated server with the following general specifications:

Windows 2003 RC2
IIS 6.0
PHP 5.2.10
MySQL 5.1.36

I've searched a lot in the internet trying to figure out where the problem is, but I have no idea.

Please help! :-S

Link to comment
Share on other sites

Well, I've found the problem.

It was related to file "config.inc.php" under "config" folder, at least for windows OS as in my case.

The issue was in the entry:

/* Directories */

define('_PS_ROOT_DIR_', realpath($currentDir.'/..'));

It seems that windows isn't getting the path as expected, so, I replaced the function "realpath" with the function "dirname" that gives the "root path" of the application.

The line must be as follows:

define('_PS_ROOT_DIR_', dirname($currentDir));


In my case, it solved all my headaches and now Prestashop is running smoothly on my own server.

Hope this can help to others! :)

Link to comment
Share on other sites

  • 1 month later...

Thank you for your prompt response, Blade :)
Sorry I forgot to state that I use WAMPServer on WinXP.
At installation, I have to create these folders: /themes/prestashop/lang, /tools/smarty/compile, /translations, /upload folder. Is it correct? Cos I didn't find it but the system required the folders.

Link to comment
Share on other sites

Nope, those folders are found in the root path of your prestashop installation.
The problem is in the way the path is solved by the function in PHP. You must search under folder "config" for the file “config.inc.php”, then edit the file (I used wordpad) and search for the line:

/* Directories */

define(’PS_ROOT_DIR‘, realpath($currentDir.’/..’));

And then change it in this way:

define(’PS_ROOT_DIR‘, dirname($currentDir));

And save the file. It should work for you as it worked for me.
Good luck!!!

Link to comment
Share on other sites

  • 6 months later...

on Windows 2008 server - /config/config.inc.php
replace row:
define('_PS_ROOT_DIR_', realpath($currentDir.'/..'));
with:
define('_PS_ROOT_DIR_', 'C:/../../wwwroot');

Note: change backslashes '\' in windows path with slashes '/'

Link to comment
Share on other sites

  • 1 year later...

Just an update.
In newer prestashop versions the file you need to change is: /config/defines.inc.php
You change this line:
define('PS_ROOT_DIR', realpath($currentDir.'/..'));
into this:
define('PS_ROOT_DIR', dirname($currentDir));

Link to comment
Share on other sites

  • 1 year later...

Hi All,

 

I have done as suggested above but still I get

PHP Fatal error: require_once() [function.require]: Failed opening required 'D:\Domains\myURL\wwwroot\shop\config/tools/smarty/Smarty.class.php' (include_path='.;C:\php5\pear') in D:\Domains\myURL\wwwroot\shop\config\smarty.config.inc.php on line 29

 

I have changed the defines.inc line to

define('_PS_ROOT_DIR_', dirname($currentDir.'/shop'));

 

This is driving me crazy

Edited by redbeetle4403 (see edit history)
Link to comment
Share on other sites

  • 3 years later...

How to Solve it ?

 

Warning: require_once(/home1/sworld/public_html/wholesalestationery.in/tools/smarty/Smarty.class.php): failed to open stream: No such file or directory in/home1/sworld/public_html/wholesalestationery.in/config/smarty.config.inc.php on line 29

Fatal error: require_once(): Failed opening required '/home1/sworld/public_html/wholesalestationery.in/tools/smarty/Smarty.class.php' (include_path='.:/opt/php55/lib/php') in/home1/sworld/public_html/wholesalestationery.in/config/smarty.config.inc.php on line 29

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...