RE: [PHP] PHP require_once() opens some files but not others in same library

2009-04-07 Thread Henning Glatter-Gotz
 Maybe ask on the zend list - 
 http://framework.zend.com/community/resources since they will be 
 familiar with it.

 Still sounds like a url is being used for a require/include but *shrug*.

The issue resolved itself when I moved the domain to a different server. I
had to do this for other reasons and now the previously described issues no
longer occur.

Cheers
Henning



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP require_once() opens some files but not others in same library

2009-04-06 Thread hglattergotz

Hello,

I have a very simple form created with the help of Zend Framework with only
one text box that loads fine on my two development machines (Win and Linux)
but generates 2 warnings and a fatal error on my production Linux machine.

For this test I am using PHP 5.2.3 and I added the path to the Zend
Framework Library in my php.ini file. File permissions are good (everyone
can at least read).

I have added the PHP code here for completeness, but it might not be
important for this problem. The error messages below are what I really need
help with.

Contents of formtest.php:
   require_once('formclass.php');

   $f = new ZDF();
   $request = new Zend_Controller_Request_Http();
   $view = new Zend_View( array( 'basePath' = '/templates' ) );
   $view-addHelperPath( 'Zend/View/Helper/', 'Zend_View_Helper' );
   echo $f-render( $view );

Contents of formclass.php
   require_once('Zend/Form.php');
   require_once('Zend/View.php');
   require_once('Zend/Controller/Request/Http.php');

   class ZDF extends Zend_Form
   {
  public function init()
  {
 $this-setAction( 'testform1.php' );
 $this-setMethod( 'post' );
 $this-setAttrib( 'id', 'testform' );

 $e = $this-createElement( 'Text',
'firstname',
array( 'label' = 'First name',
   'required' = 'true',
   'invalidMessage' = 'This field
cannot be left blank.' ) );
 $this-addElement($e);

 $this-addElement('submit', 'Submit', array('label' = 'Submit'));
  }

  public function setView(Zend_View_Interface $view) {
 parent::setView($view);
 foreach ($this as $item) {
$item-setView($view);
 }
 return $this;
  }
   }

Here are the warnings and the error that I get:

Warning: Zend_Loader_PluginLoader::require_once()
[function.Zend-Loader-PluginLoader-require-once]: couldn't resolve host name
in /usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on line 389

Warning:
Zend_Loader_PluginLoader::require_once(Zend/Loader/PluginLoader/Exception.php)
[function.Zend-Loader-PluginLoader-require-once]: failed to open stream:
Success in /usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on
line 389

Fatal error: Zend_Loader_PluginLoader::require_once() [function.require]:
Failed opening required 'Zend/Loader/PluginLoader/Exception.php'
(include_path='.:/usr/local/php5/lib/php:/usr/local/php5/lib/php/library')
in /usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on line 389

Please note that the script got to line 389 of the PluginLoader.php file,
which means that it was able to load that file, which furthermore indicates
that the include path is correct and working. However, it cannot open the
file Zend/Loader/PluginLoader/Exception.php.
This file exists and has read permissions for everyone.
Another really perplexing issue is that when I add some debug code in the
PluginLoader.php file just before line 389 and call
file_exists('/usr/local/php5/lib/php/library/Zend/Loader/PluginLoader/Exception.php')
it returns false. When I open a console and copy and paste this absolute
path into a call to vi for example, it opens the file. So the file exists,
php was able to open the PluginLoader.php at an earlier point file but now
all of a sudden it cannot open a file that clearly exists.

when I hard code the absolute path on line 389 the first warning changes to
Warning: Zend_Loader_PluginLoader::require_once()
[function.Zend-Loader-PluginLoader-require-once]: URL using bad/illegal
format or missing URL in
/usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on line 389

My first reaction was that this is a permissions problem, but even after
doing a chmod -R 777 on the Zend directory it does not work. My next guess
was open file limit, but my hosting companies support told me the limit is
set to 4000 and it is not even coming close to that.

Any ideas?
Thanks
Henning 
-- 
View this message in context: 
http://www.nabble.com/PHP-require_once%28%29-opens-some-files-but-not-others-in-same-library-tp22912504p22912504.html
Sent from the PHP - General mailing list archive at Nabble.com.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP require_once() opens some files but not others in same library

2009-04-06 Thread Chris


snip


Here are the warnings and the error that I get:

Warning: Zend_Loader_PluginLoader::require_once()
[function.Zend-Loader-PluginLoader-require-once]: couldn't resolve host name
in /usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on line 389


Why is this trying to load something via http (or ftp even)?

couldn't resolve hostname is not something you get when you include or 
require a file locally.



when I hard code the absolute path on line 389 the first warning changes to
Warning: Zend_Loader_PluginLoader::require_once()
[function.Zend-Loader-PluginLoader-require-once]: URL using bad/illegal
format or missing URL in
/usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on line 389


What is the absolute path you are putting in? It looks like a url 
according to the message.


It should be a file path:

/usr/local/php5/lib/php/library/Zend/blah/blah/blah

--
Postgresql  php tutorials
http://www.designmagick.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP require_once() opens some files but not others in same library

2009-04-06 Thread Chris

Henning Glatter-Gotz wrote:

Chris,

At no point am I using a URL.
Under normal circumstances the code includes (require_once) things like
Zend/Loader/blablabla. Because this does not resolve in the local
directory it is supposed to consult the PHP include_path to look this up.
And it does this successfully up to a point.
The full path is /usr/local/php5/lib/php/library/Zend/Loader/blablabla.

When I say up to a point I mean that my code includes files in Zend/...
and it eventually ends up in the file Zend/Loader/PluginLoader.php. So the
whole include mechanism worked up to this point. However in this
PluginLoader.php file on line 389 it calls
require_once(Zend/Loader/PluginLoader/Exception.php) and this is when
things go bad.

To see if it makes a difference I modified line 389 to read
require_once(/usr/local/php5/lib/php/library/Zend/Loader/PluginLoader/Excep
tion.php) and got the slightly different error as described in my original
post.


Maybe ask on the zend list - 
http://framework.zend.com/community/resources since they will be 
familiar with it.


Still sounds like a url is being used for a require/include but *shrug*.

--
Postgresql  php tutorials
http://www.designmagick.com/


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP require_once() opens some files but not others in same library

2009-04-06 Thread Henning Glatter-Gotz
Chris,

At no point am I using a URL.
Under normal circumstances the code includes (require_once) things like
Zend/Loader/blablabla. Because this does not resolve in the local
directory it is supposed to consult the PHP include_path to look this up.
And it does this successfully up to a point.
The full path is /usr/local/php5/lib/php/library/Zend/Loader/blablabla.

When I say up to a point I mean that my code includes files in Zend/...
and it eventually ends up in the file Zend/Loader/PluginLoader.php. So the
whole include mechanism worked up to this point. However in this
PluginLoader.php file on line 389 it calls
require_once(Zend/Loader/PluginLoader/Exception.php) and this is when
things go bad.

To see if it makes a difference I modified line 389 to read
require_once(/usr/local/php5/lib/php/library/Zend/Loader/PluginLoader/Excep
tion.php) and got the slightly different error as described in my original
post.

I have tried to find something about this type of error on Google, but most
search results are pages of web sites that are written in php that at the
time of indexing displayed this error. The sites don't actually have
anything to do with PHP development.

I have even gone as far as downloading the php source code to try and see if
I can figure out why this type of error world be caused. No luck yet.

Cheers
Henning

-Original Message-
From: Chris [mailto:dmag...@gmail.com] 
Sent: Monday, April 06, 2009 11:05 PM
To: hglattergotz
Cc: php-general@lists.php.net
Subject: Re: [PHP] PHP require_once() opens some files but not others in
same library


snip

 Here are the warnings and the error that I get:
 
 Warning: Zend_Loader_PluginLoader::require_once()
 [function.Zend-Loader-PluginLoader-require-once]: couldn't resolve host
name
 in /usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on line
389

Why is this trying to load something via http (or ftp even)?

couldn't resolve hostname is not something you get when you include or 
require a file locally.

 when I hard code the absolute path on line 389 the first warning changes
to
 Warning: Zend_Loader_PluginLoader::require_once()
 [function.Zend-Loader-PluginLoader-require-once]: URL using bad/illegal
 format or missing URL in
 /usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on line 389

What is the absolute path you are putting in? It looks like a url 
according to the message.

It should be a file path:

/usr/local/php5/lib/php/library/Zend/blah/blah/blah

-- 
Postgresql  php tutorials
http://www.designmagick.com/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP require_once() opens some files but not others in same library

2009-04-06 Thread Henning Glatter-Gotz
snip

Maybe ask on the zend list - 
http://framework.zend.com/community/resources since they will be 
familiar with it.

Still sounds like a url is being used for a require/include but *shrug*.

-- 
Postgresql  php tutorials
http://www.designmagick.com/

I did ask on the Nabble Zend list but have not gotten a reply. Will try the
official Zend list next.
I am pretty sure that the library is not using a URL since I get this
message 

Warning: Zend_Loader_PluginLoader::require_once()
[function.Zend-Loader-PluginLoader-require-once]: URL using bad/illegal
format or missing URL in
/usr/local/php5/lib/php/library/Zend/Loader/PluginLoader.php on line 389

When I hard code the full path.

Very odd.
Thanks for taking a stab at this.

Henning


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php