View previous topic :: View next topic |
Author |
Message |
sarahfoxnz Smarty Regular
Joined: 11 Apr 2010 Posts: 76
|
Posted: Sun Apr 26, 2020 2:00 pm Post subject: ODD problem with PATH NAMES |
|
|
ODD problem with PATH NAMES.
Version: smarty-3.1.33
Ive got an odd problem with my web host. I'm certain that its the HOSTS problem & nothing to do with my PHP (or Smarty templates) scripts, but im posting it here just in case.
Basically, im using smarty & the websites look fine.. But today, i'm getting errors upon errors & more errors - all to do with path-names.
Version: smarty-3.1.33
I've got logs upon logs & more logs than you can log.. & they all indicate a similar problem..
(ive reviewed a MB of logs so far)
1) Ive been to the live-chat for my host - they confirm that my root path for my domain is /http/example/blah/one/ etc..
2) the online portal where i can edit/control the domain with my host (not the php/html files themselves) - show my root path is /http/example/blah/one/
(I upload all my PHP / HTML files etc via regular FTP)
3) if i create a basic php script to show me the path name of the file - it tells me it is /http/example/blah/one/
PROBLEM:-
The templates themselves *DO NOT* have any php code to change the path name. However, this is just an example error i'm getting across 3-4 different subdomains ive checked today. (they do not share a common code).
Warning:
require_once(/Otherhttp/Two/cheese/five/usr/smarty3/libs/plugins/modifier.regex_replace.php): failed to open stream: No such file or directory in /Otherhttp/Two/cheese/five/htdocsincludes/templates/compiled/782adbaeaf224faf6a0f388e11dba2b5291aa224_0.file.header.tpl.php on line 24 Fatal error: require_once(): Failed opening required
Ive checked the header.tpl file & it definitely does not have any path-changing code. & this is happening with all the templates I see..
PHP files / template files FTP'd to my server on the host - at the correct /http/example/blah/one/ pathname.
HOWEVER - without being asked, the compiled PHP scripts are trying to access an invalid path :- /Otherhttp/Two/cheese/five/
(these are just example path names) - but all the logs i can see show this recent activity across multiple sub domains. Some sub domains i visually went to / used in the browser this morning / the other day - no errors found.
My main query is:- Is there anything in the Smarty programme/process / PHP scripts that MAY alter the path name & try & access non-existent files ?
Im waiting to hear back from my hosts technical people (hopefully soon). |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon Apr 27, 2020 3:20 pm Post subject: |
|
|
Possible issues:
1. Your Smarty settings were changed.
2. You don't have right to write to the templates/compiled
3. "htdocsincludes" looks highly suspicious. See #1 and review your Smarty settings.
4. Update Smarty. 3.1.33 is OLD and has known vulnerabilities.
5. "these are just example path names" - by this you basically denied yourself any meaningful answer to your question.
"If you censor your question, I will appropriately censor my answer." |
|
Back to top |
|
sarahfoxnz Smarty Regular
Joined: 11 Apr 2010 Posts: 76
|
Posted: Mon Apr 27, 2020 8:32 pm Post subject: |
|
|
>Possible issues:
>1. Your Smarty settings were changed.
In what way do we change our settings ? I just upload the Smarty code/programme to the /usr/ folder & access it from my subdomains in the path statements.
Ive not altered anything, except add a new plugin (which as been working).
> 2. You don't have right to write to the templates/compiled
Yes I do, Ive been using Smarty for years (& have upgraded to new Versions as i am aware of them)
>3. "htdocsincludes" looks highly suspicious. See #1 and review your Smarty settings.
see #1 settings...
> 4. Update Smarty. 3.1.33 is OLD and has known vulnerabilities.
Ive now upgraded to 3.1.34 - No change, & altered 1 of my non-working subdomains to point to the new files.. No change...
> 5. "these are just example path names" - by this you basically denied yourself any meaningful answer to your question.
"If you censor your question, I will appropriately censor my answer."
Sorry.. |
|
Back to top |
|
sarahfoxnz Smarty Regular
Joined: 11 Apr 2010 Posts: 76
|
Posted: Mon Apr 27, 2020 8:49 pm Post subject: |
|
|
Ps the htdocsincludes directory is mine - Not suspicious..
I'll try & fix things after i come back from work.. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Apr 28, 2020 12:26 am Post subject: |
|
|
Make sure your template/cache directory settings use absolute paths to begin with.
Other than that, it's very hard to give any directions without very specific knowledge. |
|
Back to top |
|
sarahfoxnz Smarty Regular
Joined: 11 Apr 2010 Posts: 76
|
Posted: Tue Apr 28, 2020 1:52 am Post subject: |
|
|
AnrDaemon wrote: | Make sure your template/cache directory settings use absolute paths to begin with.
Other than that, it's very hard to give any directions without very specific knowledge. |
Ok, I'll try that when i return home (working at home is fun...)
This morning i fixed one page in my website- But another page using the same Smarty files is still causing errors..
EDIT: Ive just checked one of my templates.inc.php filess and it does have the full / exact path.
Front page - OK - http://www.kwister.com
This page using same template path - has errors:
http://www.kwister.com/login
CORRECT PATH:
$template_path = '/home/users/web/b2516/pow.gorst/htdocsincludes/templates';
My www site is just 1 (boring page) - I should update that :). But my subdomains use their own template files in a different directory...
but the above error will advise/show the problem.
Back to work - back later to debug |
|
Back to top |
|
sarahfoxnz Smarty Regular
Joined: 11 Apr 2010 Posts: 76
|
Posted: Tue Apr 28, 2020 12:55 pm Post subject: |
|
|
Slowly fixing the site
1) hard-coding the full pathnames into a global variable & using that for each path name i need.
2) installed latest Smarty version & updating each script to use the new version |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Apr 28, 2020 1:45 pm Post subject: |
|
|
Check the
Code: | $smarty->setCacheDir(…);
$smarty->setCompileDir(…); |
settings. |
|
Back to top |
|
bsmither Smarty Elite
Joined: 20 Dec 2011 Posts: 322 Location: West Coast
|
Posted: Tue Apr 28, 2020 6:36 pm Post subject: |
|
|
You are seeing errors, but is your web site(s) crashing?
You and your host agree that your path is:
/http/example/blah/one/
But has the host admitted to there being, or not being, this existing path:
/Otherhttp/Two/cheese/five/
I might be inclined to check if other accounts on that server are saving it's errors to your logs.
Does this path exist relative to your site's document root folder:
usr/smarty3/libs/plugins/modifier.regex_replace.php
I would also check to see what PHP has for its include_path:
Code: | <?php
echo ini_get('include_path');
?> |
Smarty will use the include_path, if Smarty is enabled to do so, to look for plugins - which is what this error is reporting.
https://www.smarty.net/docs/en/variable.use.include.path.tpl
The doc page does not say what the default enabled state is.
I've run into errors when Smarty was wanting to look in PEAR directories. |
|
Back to top |
|
|