Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Warning: require_once(Smarty/lib/Smarty.class.php)
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup
View previous topic :: View next topic  
Author Message
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Thu May 16, 2013 6:47 pm    Post subject: Warning: require_once(Smarty/lib/Smarty.class.php) Reply with quote

I'm receiving the following error when I go on http://mydomain.net/smart.index.php

Code:

arning: require_once(Smarty/lib/Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/USERNAME/public_html/smarty/CustomSmarty.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'Smarty/lib/Smarty.class.php' (include_path='.:/usr/share/pear:/usr/share/php:./smarty/libs') in /home/USERNAME/public_html/smarty/CustomSmarty.php on line 3


How do I fix this?
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu May 16, 2013 8:59 pm    Post subject: Reply with quote

In CustomSmarty.php on line 3 the relative filepath does not point to your real location óf Smarty.class.php
Back to top
View user's profile Send private message
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Fri May 17, 2013 3:22 am    Post subject: Reply with quote

Isn't it the right location according to the image below?

Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri May 17, 2013 1:14 pm    Post subject: Reply with quote

you have ./smarty/libs in your filepath, the actual path appears to be ./smarty/lib
Back to top
View user's profile Send private message Visit poster's website
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Sat May 18, 2013 4:50 am    Post subject: Reply with quote

Hi,

Thanks but I tried it seems to be giving the same error except this time there's no extra appending s.

The error message is as follow:


Warning: require_once(smarty/lib/Smarty.class.php) [function.require-once]: failed to open stream: No such file or directory in /home/USERNAME/public_html/smarty/CustomSmarty.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'smarty/lib/Smarty.class.php' (include_path='.:/usr/share/pear:/usr/share/php:./smarty/lib') in /home/USERNAME/public_html/smarty/CustomSmarty.php on line 3
Back to top
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 96

PostPosted: Sat May 18, 2013 9:35 am    Post subject: Reply with quote

I don't think you can put a relative ./xxx path into the php.ini include path...
Code:
(include_path='.:/usr/share/pear:/usr/share/php:./smarty/lib')
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat May 18, 2013 12:31 pm    Post subject: Reply with quote

In which folder is CustomSmarty.php file located?
Back to top
View user's profile Send private message
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Sun May 19, 2013 6:07 am    Post subject: Reply with quote

U.Tews wrote:
In which folder is CustomSmarty.php file located?


It's in public_html/smarty/

The path to customsmarty.php file is public_html/smarty/customsmarty.php

Aristophan wrote:
I don't think you can put a relative ./xxx path into the php.ini include path...
Code:
(include_path='.:/usr/share/pear:/usr/share/php:./smarty/lib')


Wait then how did I get smart/lib then? (I'm not being sarcastic lol, I'm confused)
Back to top
View user's profile Send private message
Aristophan
Smarty Regular


Joined: 10 Jan 2011
Posts: 96

PostPosted: Sun May 19, 2013 8:15 am    Post subject: Reply with quote

...without php.ini's include_path! Just as easy as this:
Code:
            @define('SMARTY_DIR', '/home/USERNAME/public_html/Smarty/libs/');
            if (!class_exists('Smarty')) {
                include SMARTY_DIR . 'Smarty.class.php';
            }
            // debugging...
            $smarty->testInstall();exit;

Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun May 19, 2013 11:46 am    Post subject: Reply with quote

Yeah, remove the set_include_path() stuff.

If CustomSmarty.php is in public_html/smarty/ it must be


CustomSmarty.php
Code:
<?php
require_once('lib/Smarty.class.php');
...


or use Aristophan solution by defining 'SMARTY_DIR'
Back to top
View user's profile Send private message
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Mon May 20, 2013 2:52 am    Post subject: Reply with quote

That did the trick. It worked! Thanks a ton but there's another problem.

Can you please help me with this error too?

Code:

Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead in /home/USERNAME/public_html/smarty/index.php on line 36

Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Denver' for 'MDT/-6.0/DST' instead in /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_templatecompilerbase.php on line 177

Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template &quot;/home/USERNAME/public_html/smarty/templates/index.html&quot; on line 1 &quot;{extends file=\&amp;quot;base_template.html\&amp;quot;}&quot; - Unexpected &quot;\&quot;' in /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_templatecompilerbase.php:665 Stack trace: #0 /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_templateparser.php(3144): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_templateparser.php(3209): Smarty_Internal_Templateparser->yy_syntax_error(10, '\') #2 /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_smartytemplatecompiler.php(105): Smarty_Internal_Templateparser->doParse(10, '\') #3 /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_templatecompilerbase.php(200): Smarty_Internal_SmartyTemplateCompiler->doCompile('{extends file=\...') #4 /home/USERNAME/public_html/smarty/lib in /home/USERNAME/public_html/smarty/lib/sysplugins/smarty_internal_templatecompilerbase.php on line 665
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Mon May 20, 2013 8:54 am    Post subject: Reply with quote

You did not specify a time zone in your php.ini with the date.timezone parameter.

See also http://www.php.net/manual/en/function.date-default-timezone-set.php

Also you are getting again the compiling errors regarding quotes.

I still think your PHP does escape the quotes with \ when it reads files.
Back to top
View user's profile Send private message
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Wed May 22, 2013 3:44 am    Post subject: Reply with quote

Hi U.tews, you were right. I did not specify any timezone in my php.ini file. I added a location. Here is the code I added:

Code:


[Date]
; Defines the default timezone used by the date functions
date.timezone = America/Denver


I hard refreshed the page and even restarted the container but still see the same errors with the timezone. Also, I contacted my hosting to ask them to check if I have installed Smarty correctly or not.
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Wed May 22, 2013 1:06 pm    Post subject: Reply with quote

timmy5000 wrote:
Hi U.tews, you were right. I did not specify any timezone in my php.ini file. I added a location. Here is the code I added:

Code:


[Date]
; Defines the default timezone used by the date functions
date.timezone = America/Denver


I hard refreshed the page and even restarted the container but still see the same errors with the timezone. Also, I contacted my hosting to ask them to check if I have installed Smarty correctly or not.


Did you restart the web server?
Back to top
View user's profile Send private message Visit poster's website
timmy5000
Smarty Rookie


Joined: 11 May 2013
Posts: 15

PostPosted: Thu May 23, 2013 4:32 am    Post subject: Reply with quote

I feel really stupid lol.

I restarted the server and the timezone errors are still there. Sorry for all the trouble, I bought the AdultVideoScript software and their support techies are not helping me at all, they are clearly ignoring my requests. I really appreciate your help so far Mohrt and U.tews. If you both want, I could pay you two for the help.

Also, I received a reply from my host and they said the following:

Code:

 Hello, I apologize for the delay, we are undergoing very high ticket volumes. I was able to trace the page load of your site and i believe that the issue is within your Smarty_Compiler.class.php file. I was able to run the script Smarty.class.php without an error, but when i run Smarty_Compiler.class.php it throws an error due to the class Smarty_Compiler. This is not a system compiler or part of PHP,but a class in the smarty code. This could mean the installation is missing some files, or a variable in the files is incorrect. I recommend contacting your developer to see if he or she can track down the problem in the code. Thank you. ------------------------------------------------------------------------------------------------------------------ mmap(NULL, 92644, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ae0cdcee000 brk(0x1fafc000) = 0x1fafc000 brk(0x1fb3c000) = 0x1fb3c000 brk(0x1fb7c000) = 0x1fb7c000 munmap(0x2ae0cdcee000, 92644) = 0 close(3) = 0 munmap(0x2ae0cdb99000, 4096) = 0 write(2, "PHP Fatal error: Class 'Smarty' not found in /home/USERNAME/public_html/include/smarty/libs/Smarty_Compiler.class.php on line 35\n", 128PHP Fatal error: Class 'Smarty' not found in /home/USERNAME/public_html/include/smarty/libs/Smarty_Compiler.class.php on line 35 Phillip D


Thanks a ton everyone for your help, I would really really appreciate it if you could help me more further.


Last edited by timmy5000 on Sat Dec 21, 2013 3:03 am; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Installation and Setup All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP