0

I've been trying to install Zend Gdata. I'm running from a dev environment so have access to php.ini.

I've set the include path and when I run the verification script I get the following..

Ran PHP Installation Checker on 2011-04-28T02:25:20+00:00 PHP Extension Errors Tested No errors found Zend Framework Installation Errors Tested No errors found SSL Capabilities Errors Tested No errors found YouTube API Connectivity Errors Tested No errors found

But when I try to run any of the demo files I get the floowing error...

Warning: require_once(Zend/Loader.php): failed to open stream: No such file or directory in /usr/lib/php/ZendGdata/demos/Zend/Gdata/blogger.php on line 37

Fatal error: require_once(): Failed opening required 'Zend/Loader.php' (include_path='.:/usr/lib/php') in /usr/lib/php/ZendGdata/demos/Zend/Gdata/blogger.php on line 37

The most logical conclusion is that there is a problem with the include path, but I have checked it and it seems right.

Here's what I have for it...

.:/usr/lib/php/ZendGdata/library/Zend:/usr/lib/php/ZendGdata/library/

Any suggestions would be greatly appreciated.

Charles
  • 50,943
  • 13
  • 104
  • 142
Robert
  • 1
  • 1
  • 1
  • Where are you getting that include path from? Where are you setting that? – JohnD Apr 28 '11 at 02:58
  • I am getting the include path based on where I put the files. Here's the path from the info panel of the 'library' folder... /usr/lib/php/ZendGdata I an setting this (via command line) in /private/etc/ – Robert Apr 28 '11 at 03:16

2 Answers2

0
$clientLibraryPath = 'ZendGdata/library';
$oldPath = set_include_path(get_include_path() . PATH_SEPARATOR . $clientLibraryPath);

if you do not know the root path of the server, use relative path for accessing library. Its pretty handy to use.

above two lines should be written on the top of any file{page1,page2,page3} having folder structure as below

  • Website
    • Page1.php
    • Page2.php
    • Page3.php
    • ZendGdata

You can use your relative path as per your need

Yogesh Gupta
  • 170
  • 1
  • 15
0

Put this in the beginning of Blogger.php

set_include_path('/usr/lib/php/ZendGdata/library' . PATH_SEPARATOR . get_include_path());

You say you're setting the include path in a configuration file but that doesn't seem to be affecting CLI. Make sure you're editing the right php.ini file with php --ini

JohnD
  • 3,884
  • 1
  • 28
  • 40
  • Putting the line of code in Blogger.php did the trick. Forgive my ignorance, but what do you mean by "Make sure you're editing the right php.ini file with php --ini"? – Robert Apr 28 '11 at 03:34
  • If you run `php` in the command line with the `--ini` argument it should give you some insight into what configuration files affect php's CLI binary. – JohnD Apr 28 '11 at 03:36
  • This is what came back... Configuration File (php.ini) Path: /etc Loaded Configuration File: (none) Scan for additional .ini files in: (none) Additional .ini files parsed: (none) – Robert Apr 28 '11 at 03:41
  • @Robert That means that if you want to make changes to php-cli's behavior you should be editing /etc/php.ini, because that's where it's looking. I think I can tell you're using OS X (I get the same output :]) so there should be a php.ini.default file in there that you can copy to php.ini and edit away. – JohnD Apr 28 '11 at 03:44
  • You're correct - OS X 10.6.7. Thing is, I'm pretty sure that is the php.ini file I'm editing. When I look at the file structure at the OS level I see that in fact the /etc/ link right below the MacHD folder is an alias. The /etc/ folder itself seems to live in the /private/ directory – Robert Apr 28 '11 at 03:52
  • here's a screen shot of the contents of /etc/ [IMG]http://i51.tinypic.com/v5zrtf.png[/IMG] (you can see previous versions of php.ini below) – Robert Apr 28 '11 at 03:57
  • Extremely odd. php should be loading that file, you should ask SU or SF about that one, I'm not sure why it wouldn't load. – JohnD Apr 28 '11 at 04:01
  • I've just done a search (of system files) of the HD. The only ones that I can find are in the /etc/ folder. But the strange thing is that the error message has the default include path, not the new one. However, when I pull up PHP info the path is correct...[IMG]http://i52.tinypic.com/2i90476.png[/IMG] – Robert Apr 28 '11 at 04:17
  • I also copied the default file over to the current and reset the path with the same result. – Robert Apr 28 '11 at 04:19
  • Again, forgive my ignorance here, but I'm pretty new to programming (and to this site), who (or what) is SU and SF? – Robert Apr 28 '11 at 04:22
  • SU and SF are Stack Overflow's sister sites, Super User and Sever Fault for power users and system administrators, respectively. Give SU a try at this problem, http://superuser.com/ – JohnD Apr 28 '11 at 04:25