function.require-once]: failed to open stream: No such file or directory

function.require-once]: failed to open stream: No such file or directory

by Terry Reid -
Number of replies: 2

When I go to do course backups I get the following errors:

 

Warning: require_once(/home/onlinele/public_html/mod/choice/backup/moodle2/backup_choice_stepslib.php) [function.require-once]: failed to open stream: No such file or directory in/home/onlinele/public_html/mod/choice/backup/moodle2/backup_choice_activity_task.class.php on line 29

Fatal error: require_once() [function.require]: Failed opening required '/home/onlinele/public_html/mod/choice/backup/moodle2/backup_choice_stepslib.php' (include_path='/home/onlinele/public_html/lib/zend:/home/onlinele/public_html/lib/pear:.:/usr/lib/php:/usr/local/lib/php') in /home/onlinele/public_html/mod/choice/backup/moodle2/backup_choice_activity_task.class.php on line 29

 

I have no idea what the problem is? Anyone? This is a Moodle 2.3.1+ (Build: 20120823)  Everything else seems to be functioning fine.

 

Thanks Terry

Average of ratings: -
In reply to Terry Reid

Re: function.require-once]: failed to open stream: No such file or directory

by Ken Task -
Picture of Particularly helpful Moodlers

Just preceeding line 29 of that file

defined('MOODLE_INTERNAL') || die();

Line 29: require_once($CFG->dirroot . '/mod/choice/backup/moodle2/backup_choice_stepslib.php');
Line 30: require_once($CFG->dirroot . '/mod/choice/backup/moodle2/backup_choice_settingslib.php');

comment after those lines:

 * Provides the steps to perform one complete backup of the Choice instance

Do the backup_choice_stepslib.php and backup_choice_settingslib.php files reside in:
/[yourmoodle]/mod/choice/backup/moodle2

Looks like you are remotely hosted and may have FTP'd the extracted moodle version locally then uploaded.  Some remotely hosted sites or FTP software may have issues with transferring a large number of files all at once.  Are the files there? or are they missing?  or do they have correct permissions for your system such that apache user can see them?

'spirit of sharing', Ken

In reply to Ken Task

Re: function.require-once]: failed to open stream: No such file or directory

by Howard Gaukrodger -

SOLVED - in my case...

I had almost the identical problem, but with a different file - locallib.php - so I thought I'd share my experience.

Environment: Win Vista, FF 18, Moodle 2.3.1, PHP 5.3.

On saving a new course, the screen would display the white screen of death. Debugging identified the locallib.php file to be missing from the /enrol directory. On copying this file into the /enrol directory, everything was fine. Easy when you know!

What I don't understand is why the file wasn't there in the first place. wide eyes