Smarty Installation

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Wolfie
Forum Commoner
Posts: 37
Joined: Wed Jan 28, 2009 8:40 am
Location: Poland

Smarty Installation

Post by Wolfie »

Hello all

I am getting sick of this....
I am trying to figure out what is wrong with my installation of smarty.
The problem is that I have done everything like in the manual.
I have set all the folders properly and when I am including smarty like this :

Code: Select all

 
// load Smarty library
require('c:/smarty/libs/Smarty.class.php');
 
Everything is just fine but it is not optimal solution

cause it should be like this :

Code: Select all

 
// load Smarty library
require('Smarty.class.php');
 
But in this case it is not working telling me that :
Warning: require(Smarty.class.php) [function.require]: failed to open stream: No such file or directory in C:\Program Files\WebServ\httpd\index.php on line 4

Fatal error: require() [function.require]: Failed opening required 'Smarty.class.php' (include_path='.;C:\php5\pear') in C:\Program Files\WebServ\httpd\index.php on line 4
Enybody know what is the problem ?

One more thing :
When I'm opening my PROPER (checked in phpinfo.php) php.ini there is nothing more than this :
; PHP
Of course I have included the path to smarty so now php ini looks something like this :
; PHP
include_path = ".;c:\smarty\libs"
Enyway when I am including file Smarty.class.php without full path it is not working.
Please help !
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Smarty Installation

Post by John Cartwright »

before including the object, check the include path was correctly set by adding

Code: Select all

echo get_include_path();
and post the results back.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Smarty Installation

Post by John Cartwright »

Actually, from your error you can see that the include path was in fact not set.

Create a new file and only add

Code: Select all

<?php 
 
phpinfo();
 
?>
to see which php.ini was loaded, and make sure you are modifying the correct one. Is is typical to have several php.ini's on the filesystem, which makes this an easy mistake to make.

Otherwise, you can directly change the include path with set_include_path(), i.e.

Code: Select all

set_include_path(get_include_path . PATH_SEPARATOR . 'c:/smarty/libs/');
Wolfie
Forum Commoner
Posts: 37
Joined: Wed Jan 28, 2009 8:40 am
Location: Poland

Re: Smarty Installation

Post by Wolfie »

I have marked it in my previous post in capital letters that I am changing proper php.ini....
But why it is't working properly, on the other computer everything was fina without including full path.
And another question, it is normal that in php.ini there is nothing ? only this :
; PHP
When I am using the function get_include_path(); I am getting
.;C:\php5\pear
I don't know why and what does it means.....
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Smarty Installation

Post by John Cartwright »

There is a reason I asked you to double check your phpinfo for the location of the php.ini....

All you have it that in your php.ini? That doesn't sound right. Try setting the include path in code like I suggested to see if that works.
Post Reply