Re: DataObject ini error
| From: | Sarah Gray | Date: | Tue, 25 May 2004 00:50:19 +0000 |
| Subject: | Re: DataObject ini error | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-12713@lists.php.net to get a copy of this message | ||
Hi,
I tried #1 (will try #2 shortly -- re-installing PEAR). I had limited success. I no
longer received the error, and in fact the script got to Generate.php and printed out
CREATING FOR mysql://sg:password@localhost/database (again with the actual existent db
names in this string).
After printing that line, the script stopped executing and returned to the command
prompt. Nothing else was printed out, not the word DONE or any tables; and no files
were created. The execution time was less than a second.
While I try re-installing PEAR, are there any other thoughts I should keep in mind?
Thanks,
Sarah
Norbert Mocsnik wrote:
> Hello,
>
> try 1.
> Instead of using an ini-file, I'd try to set $options like this:
>
> http://pear.php.net/manual/en/package.database.db-dataobject.intro-configuration.php
> Example 22-2. Setting the default options
> second part of the example
>
> try 2.
> re-install PEAR instead of updating files manually
>
> (my) good pratice: use absolute paths for 'require_prefix' and
> 'class_prefix' also
>
> Regards,
> Norbert
>
> Sarah Gray wrote:
>
> > 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.
> >