Neocortex
Neocortex

Reputation: 663

Failed to open stream: No such file or directory & Failed opening required

Disclaimer: There are similar kind of issues posted in stack overflow but those questions are their respective answers, neither suited this issue nor their answers helped to fix. Those problems are different and answers suited only those specific questions and not generic. They are no way helpful after a long struggle thinking twice I am posting this question to get a help. If someone don't like this question or don't understand, please communicate and get clarified instead of barely setting flag to close this question; better you can ignore and pass on...Thank you!

Requirement : I am using Zend framework for google calendar API with a core PHP website. It's an online taxi booking. If someone wants to book a taxi, the form should use the booking details to mark on the google calendar then database and finally paypal. If the payment is made in paypal then again it should update by a re-phrasing the calendar data to something like "Paid" else "Payment - Pending".

Problem : If I try to add the below code in the file the program throws the error message which is from the below line of codes.


.

This code is used to add an event to the google calendar.

How I should fix this issue?

Source Code:

error_reporting(E_ALL);

define('ROOT_DIR', dirname(dirname(FILE)));

// Setup path to the Zend Framework files

set_include_path('.' . PATH_SEPARATOR . ROOT_DIR.'/app/' . PATH_SEPARATOR . ROOT_DIR.'/lib/' . PATH_SEPARATOR . ROOT_DIR.'/lib/incubator' . PATH_SEPARATOR . get_include_path() );

echo 'Setup path to the Zend Framework files - completed'.'
';

error_reporting(E_ALL);

// Register the autoloader

require_once 'Zend/Loader.php';

echo 'loader.php - require() completed'.'
';

Zend_Loader::loadClass('Zend_Gdata'); Zend_Loader::loadClass('Zend_Gdata_ClientLogin'); Zend_Loader::loadClass('Zend_Gdata_Calendar'); Zend_Loader::loadClass('Zend_Http_Client');

echo 'Register the autoloader - Completed';

// connect to service

$gcal = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; $user = "[email protected]"; $pass = "*"; $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $gcal);

echo 'connect to service - Completed';

ERRORS:

// I have printed this statement - refer above code.

Setup path to the Zend Framework files - completed

  1. Warning: require_once(Zend/Loader.php): failed to open stream: No such file or directory in /home/website/public_html/add-session-dev.php on line 20

  2. Fatal error: require_once(): Failed opening required 'Zend/Loader.php' (include_path='.:/home/website/app/:/home/website/lib/:/home/website/lib/incubator:.:/usr/share/pear:/usr/share/php') in /home/website/public_html/add-session-dev.php on line 20

There are nothing executed after the above errors.

Upvotes: 1

Views: 4225

Answers (1)

Neocortex
Neocortex

Reputation: 663

Search for

Change the below from

define('ROOT_DIR', dirname(dirname(FILE)));

to the below

define('ROOT_DIR', dirname(dirname(FILE))."/public_html/zend");

and everything has worked fine for me. If anyone couldn't be able to fix this issue let me know.

Upvotes: 1

Related Questions