0

I'm running out of ideas here. Physically, my Zend install (XAMPP on Windows) is located at D:\xampp\htdocs\newsite\zend\library.

So far, I've managed to fail with all of the following include paths, as reported in zend.php (located at D:\xampp\htdocs\newsite and accessed from 127.0.0.1/newsite/zend.php.

.;D:\xampp\php\PEAR
.;D:\xampp\php\PEAR;/zend/library
.;D:\xampp\php\PEAR;D:\xampp\htdocs\newsite\zend\library
.;D:\xampp\php\PEAR;D:/xampp/htdocs/newsite/zend/library
.;D:/xampp/htdocs/newsite/zend/library
.;D:\xampp\htdocs\newsite\zend\library
D:\xampp\htdocs\newsite\zend\library
.;./zend/library;D:\xampp\php\PEAR;D:\xampp\htdocs\newsite\zend\library
.;./zend/library;D:\xampp\php\PEAR;D:\xampp\htdocs\newsite\zend\library;/zend/library
.;./zend/library;D:\xampp\php\PEAR;D:\xampp\htdocs\newsite\zend\library;D:/xampp/htdocs/newsite/zend/library

EDIT: Yes, I got all of the above through get_include_path(). I'm on PHP 5.3.8.

Tortoise
  • 208
  • 3
  • 11

2 Answers2

1

Assuming you are not trying to use auto loading, which would be a good idea to rule out problems with auto loaders.

Since the include_path returns ".;D:\xampp\php\PEAR;D:\xampp\htdocs\newsite\zend\library" I would expect a simple include to work.

Assuming you are using ZF2, this test should not error, if the above include path is being returned:

<?php
include ('Zend\Version\Version.php');

If that does error, try it with a full path to verify if it's the include path or something else that is causing the file not to be included.

<?php
include ('D:\xampp\htdocs\newsite\zend\library\Zend\Version\Version.php');

If your test is more complicated that the above, maybe it's something other than the include path going wrong. Can you post the code that is failing?

Also, you might consider installing the ZF2 Skeleton App, which shows current best practices for setting up autoloading, namespaces, etc.

https://github.com/zendframework/ZendSkeletonApplication

dualmon
  • 1,225
  • 1
  • 8
  • 16
  • Hmm, that include doesn't error, but the InstallationChecker does; I'll try implementing ZF in another file and see if it works. – Tortoise Nov 04 '12 at 21:38
  • Okay, good. I highly recommend installing the Skeleton App from github. It's kind of a pain to get Composer figured out the first time, but I think once you do, you will wonder how you ever lived without it. Plus, installing it that way sets up autoloading correctly for you, and gives you a leg up on the recommended conventions for namespaces. – dualmon Nov 04 '12 at 22:50
0

While using Zend Library, make sure

1) You have parent dir of Zend folder in include paths D:\xampp\htdocs\newsite\zend\library has to be in include paths, not D:\xampp\htdocs\newsite\zend\library\Zend

2) PHP not running in safe mode, also PHP is updated to 5.2+ or 5.3+ and if apc is turned on, it must have apc.include_once_override off.

If still not working, inspect by printing get_include_path() or phpinfo();

That should be it.

Amit Kriplani
  • 682
  • 5
  • 12
  • Condition 1 is satisfied. I'm assuming that my PHP is not running in safe mode, as I'm on 5.3.8 and not getting E_DEPRECATED; as for apc.include_once_override, I've never used it in any of my code, and I doubt the Zend library would use it if it would break itself. get_include_path() returns the expected value. – Tortoise Nov 04 '12 at 17:00