0
votes

I have just installed propel orm and done the setting, but after including the lib/propel.php file, it couldn't find the propel.php file, here is my code

<?php
$projectPath = realpath( dirname( __FILE__ ) . DIRECTORY_SEPARATOR. '..');
$modelPath = $projectPath . "/model/classes";
// Include the man Propel script
require_once $projectPath . '/propel/lib/Propel.php';

// Initialie Propel with the runtime configuration
Propel::init('model/conf/ehm-conf.php');

// Add the generated 'classes' directory to the include path
//set_include_path("model/classes" . PATH_SEPARATOR . get_include_path());
set_include_path($modelPath . PATH_SEPARATOR . get_include_path());
?>

and here is my error output

[client 127.0.0.1] PHP Warning: require_once(C:\Apache Software Foundation\Apache2.2\htdocs/propel/lib/Propel.php) [function.require-once]: failed to open stream: No such file or directory in C:\Apache Software Foundation\Apache2.2\htdocs\ehm\propel_init.php on line 5 [Tue Nov 12 22:54:42 2013] [error] [client 127.0.0.1] PHP Fatal error: require_once() [function.require]: Failed opening required 'C:\Apache Software Foundation\Apache2.2\htdocs/propel/lib/Propel.php' (include_path='.;C:\php\pear') in C:\Apache Software Foundation\Apache2.2\htdocs\ehm\propel_init.php on line 5

2
One often runs into this error, and to quickly troubleshoot it, follow these steps : stackoverflow.com/a/36577021/2873507Vic Seedoubleyew

2 Answers

0
votes

Well your error message is clear enough : file "C:\Apache Software Foundation\Apache2.2\htdocs/propel/lib/Propel.php" was not found. So just check in which path is stored propel and set this path in your code.

Test if $projectPath contains the good path

var_dump($projectPath);
0
votes

You appear to be looking for this:

propel/lib/Propel.php

when I think in fact you want this:

propel/runtime/lib/Propel.php

I'm assuming here you're using the 1.6.x branch, and not the new 2.0.x alpha.