DataObject ini error
| From: | Sarah Gray | Date: | Mon, 24 May 2004 22:07:06 +0000 |
| Subject: | DataObject ini error | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-12710@lists.php.net to get a copy of this message | ||
Hello,
I am trying to run createTables.php and running into the following
error:
Error: could not read ini file.
I am running a script from the shell (as root) that has the following
lines:
<?php
require_once "PEAR.php";
$_SERVER['argv'][1] = "config.ini";
require_once 'DataObject/createTables.php';
?>
(I have tried with absolute paths as well and gotten the same results).
I have checked and confirmed the following:
1. createTables.php is being accessed and executed
2. The ini file is correctly passed in to createTables.php and read as
$_SERVER['argv'][1]
3. The contents of the ini file are readable by createTables.php (I can
echo out the contents of the file from within createTables.php)
4. This has failed when permissions of the ini file were 777, 757, 666.
Also, I am running as root.
5. I have debugged every line in createTables.php and find the breakdown
here:
$options = &PEAR::getStaticProperty('DB_DataObject','options');
Meaning, when I test for the value of $options after this line has
executed, it turns up nothing. This is consistent with the error, as I
see this particular error is triggered when there is no value for
$options. Before this line I can print_r($config) and see all the file
contents, so something is wrong here and I'm not sure what it is.
I found a post earlier today saying I should get the most recent version
of PEAR.php (earlier I was getting a getStaticProperty error -- as in
the method did not exist). Once I overwrote my copy of PEAR.php with the
most recent version of PEAR.php, this error disappeared.
BTW, my config file has the following contents (password and dbname
masked here but correct in actual file):
database = mysql://sg:password@localhost/dbname
schema_location = /usr/local/psa/home/vhosts/morchand.com/httpdocs/db
class_location = /usr/local/psa/home/vhosts/morchand.com/httpdocs/db
require_prefix = DataObjects/
class_prefix = DataObjects_
It is likely that I am missing something obvious, but as with most
errors of the sort I cannot see what it is and do not know what else to
try. I would greatly appreciate any comments or suggestions.
Thanks,
s.