K
K
Konstantin2011-06-22 13:57:26
PHP
Konstantin, 2011-06-22 13:57:26

PHP not handling require?

[Wed Jun 22 13:13:41 2011] [error] [client 82.207.46.177] PHP Warning: require_once() [<a href="http://function.require-once">function.require-once</a>]: URL using bad/illegal format or missing URL in /data/domains/dev2.random.net.ua/public_html/classes/smarty/smarty.class.php on line 799<br/>
[Wed Jun 22 13:13:41 2011] [error] [client 82.207.46.177] PHP Warning: require_once(/data/domains/dev2.random.net.ua/public_html/classes/smarty/sysplugins/smarty_internal_template.php) [<a href="http://function.require-once">function.require-once</a>]: failed to open stream: operation failed in /data/domains/dev2.random.net.ua/public_html/classes/smarty/smarty.class.php on line 799<br/>
[Wed Jun 22 13:13:41 2011] [error] [client 82.207.46.177] PHP Fatal error: require_once() [<a href="http://function.require">function.require</a>]: Failed opening required '/data/domains/dev2.random.net.ua/public_html/classes/smarty/sysplugins/smarty_internal_template.php' (include_path='.:/opt/csw/php5/lib/php/') in /data/domains/dev2.random.net.ua/public_html/classes/smarty/smarty.class.php on line 799

function smartyAutoload($class)<br/>
{<br/>
 $_class = strtolower($class);<br/>
 if (substr($_class, 0, 16) === 'smarty_internal_' || $_class == 'smarty_security') {<br/>
 print SMARTY_SYSPLUGINS_DIR . $_class . '.php';<br/>
 require_once(SMARTY_SYSPLUGINS_DIR . $_class . '.php');//Строка 799<br/>
 }<br/>
}

Conclusion:
/data/domains/dev2.random.net.ua/public_html/classes/smarty/sysplugins/smarty_internal_data.php<br/>
/data/domains/dev2.random.net.ua/public_html/classes/smarty/sysplugins/smarty_internal_template.php

Upon closer analysis, it was found that after require_once 'MDB2.php'; in one of the classes does not want to include anything through autoload.
PHP 5.2.9
SunOS random.net.ua 5.10 Generic_142910-17 i86pc i386 i86pc
Any thoughts?

Answer the question

In order to leave comments, you need to log in

9 answer(s)
M
MrCrock, 2011-06-22
@MrCrock

In the smartyAutoload() function, replace require_once() with require(). You include a class inside a function, which means that all the code that is in the included file will be defined only inside this function.

J
Juggler, 2011-06-22
@Juggler

The thought is that the absolute path SMARTY_SYSPLUGINS_DIR is incorrectly specified. Type the path for the current
__FILE__ file
- you can use it to clarify what is wrong.

J
Juggler, 2011-06-22
@Juggler

or the directory for the current file
- dirname(__FILE__)

I
Iskander Giniyatullin, 2011-06-22
@rednaxi

/data/domains/dev2.random.net.ua/public_html/classes/smarty/sysplugins/smarty_internal_data.php

Do these files exist?

J
Juggler, 2011-06-22
@Juggler

Here is an interesting version www.rsdn.ru/forum/web/2930077.flat.aspx
The point is that there is not enough memory for PEAR, and strange glitches follow. Try a clean option - make a simple script where you just include PEAR, and then include another file.

J
Juggler, 2011-06-22
@Juggler

Does a clean file of this kind
require_once('/data/domains/dev2.random.net.ua/public_html/classes/smarty/smarty.class.php');
work?

A
Alexey Shein, 2011-06-22
@conf

Check the read permissions in the parent directories, this may be the problem. And yes, apc.stat = 0 sometimes caches tightly.

J
Juggler, 2011-06-22
@Juggler

If there is not much code, you can try to merge everything into one file and conduct a visual revision. Or just track where (after which command) it starts to fail.

S
Sergey Beresnev, 2011-06-23
@sectus

There is such an elusive bug: http://bugs.php.net/bug.php?id=48837

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question