OW! Zend Framework bit me OR Careful with that config

zf Ouch! I just solved a puzzling error in Zend Framework. It was telling me that I had an illegal file name. While the trace never did point to the exact line in my code that triggered it, it clearly had something to do with a PDO_SQL database.

I checked the database file and indeed the permissions were OK and the name of the file seemed as legal as anything else I had that worked.

What it turned out to be was that I used the wrong kind of quotes. Double quotes work, and also no quotes work. But don’t try to use single quotes (apostrophes) around a value in the config file. Here is the line in application.ini that caused the error:

DOESN’T WORK

resources.db.adapter         = 'PDO_SQLITE'

Here is the same config from another project that worked fine. To my eyes there was no difference between this one and the one before it. It’s not like I had variable interpolation in it or anything!!

resources.db.adapter         ="PDO_SQLITE"

And I got beyond this error and on to the next one by doing it thusly:

resources.db.adapter         = PDO_SQLITE

1 comment to OW! Zend Framework bit me OR Careful with that config

A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.