|
View:
New views
16 Messages
—
Rating Filter:
Alert me
|
|
|
ZF quickstart not working?Hi,
Is it just me or quickstart is not working. I got Message: SQLSTATE[HY000]: General error: 14 unable to open database file when I try to submit/add stuff in guestbook. I have chmod 777 data/db/guestbook-dev.db All other success messages etc are working as expected. |
|
|
Re: ZF quickstart not working?On Fri, Nov 7, 2008 at 5:04 PM, Julian Davchev <jmut@...> wrote:
> Hi, > Is it just me or quickstart is not working. > > I got > Message: SQLSTATE[HY000]: General error: 14 unable to open database file > > when I try to submit/add stuff in guestbook. > I have chmod 777 data/db/guestbook-dev.db > > All other success messages etc are working as expected. ORLY? ;-) Make sure the path to the sqlite database is correct. :-) Use an absolute path maybe. Till |
|
|
Re: ZF quickstart not working?-- Julian Davchev <jmut@...> wrote
(on Friday, 07 November 2008, 06:04 PM +0200): > Is it just me or quickstart is not working. > > I got > Message: SQLSTATE[HY000]: General error: 14 unable to open database file > > when I try to submit/add stuff in guestbook. > I have chmod 777 data/db/guestbook-dev.db The directory in which the DB file exists also needs to have RW permissions for the apache process. I usually do: chmod -R a+rwX data which ensures that the entire data/ subdirectory has these permissions. > All other success messages etc are working as expected. -- Matthew Weier O'Phinney Software Architect | matthew@... Zend Framework | http://framework.zend.com/ |
|
|
Re: ZF quickstart not working?I've managed to work through the problems with the latest quickstart tutorial to this point, but no matter how I set permissions for the files (and parent directories) I still get the "General error: 14 ..." message.
Any other ideas on how to get past here? Thanks, Breen.
|
|
|
Re: ZF quickstart not working?On Thu, May 14, 2009 at 1:07 AM, Breen Liblong <breen.liblong@...> wrote:
> > I've managed to work through the problems with the latest quickstart tutorial > to this point, but no matter how I set permissions for the files (and parent > directories) I still get the "General error: 14 ..." message. > > Any other ideas on how to get past here? Help us, so we can help you. For starters, let's say your app layout is: /root/app/controllers /root/app/models /root/app/data /root/www/index.php /root/boostrap.php Where is your SQLite database supposed to be, and are you sure it matches the path used in your PHP code? As Matthew pointed out, chmod the directory. I usually wouldn't recommend it, but a 'chmod 777 directory/' may actually help you to move forward, etc.. Till |
|
|
Re: ZF quickstart not working?OK, here's some additional information.
I'm working through the Zend Framework tutorial and have got to the Create a Model and Database Table section (http://framework.zend.com/docs/quickstart/create-a-model-and-database-table), and am stuck at executing "php scripts/load.sqlite.php" My configuration is /home/breen/tmp/zfproject/quickstart/application/controllers /home/breen/tmp/zfproject/quickstart/application/models /home/breen/tmp/zfproject/quickstart/application/data /home/breen/tmp/zfproject/quickstart/public/index.php /home/breen/tmp/zfproject/quickstart/application/Bootstrap.php The database is supposed to reside in data/db Following another reference to database problems with the tutorial (http://www.nabble.com/QuickStart-and-creating-a-SQLite-database-td20154515.html) I've tried to create the database files in data/db via touch guestbook.db touch guestbook-dev.db touch guestbook-testing.db and have even done a 'chmod -R 0777 application', all to no avail. Running php scripts/load.sqlite.php keeps giving me: Writing Database Guestbook in (control-c to cancel): AN ERROR HAS OCCURED: SQLSTATE[HY000] [14] unable to open database file The file /home/breen/tmp/zfproject/quickstart/application/configs/application.ini defines the database path as ... resources.db.params.dbname = APPLICATION_PATH "/../data/db/guestbook.db" ... so the path looks correct to me. Hope this gives you enough information to help you, help me (echoes of Jerry Maguire: "Help me ... help you. Help me, help you." :-) Please let me know if you need any additional information. Breen
|
|
|
Re: ZF quickstart not working?On Thu, May 14, 2009 at 10:03 AM, Breen Liblong <breen.liblong@...> wrote:
[snip]
Shouldn't this be APPLICATION_PATH "/data/db/guestbook.db"? Since the data directory resides in the application directory. |
|
|
Re: ZF quickstart not working?-- Mon Zafra <monzee@...> wrote
(on Thursday, 14 May 2009, 10:23 AM +0800): > On Thu, May 14, 2009 at 10:03 AM, Breen Liblong <breen.liblong@...> wrote: > OK, here's some additional information. > > I'm working through the Zend Framework tutorial and have got to the Create > a > Model and Database Table section > (http://framework.zend.com/docs/quickstart/ > create-a-model-and-database-table), > and am stuck at executing "php scripts/load.sqlite.php" > > My configuration is > /home/breen/tmp/zfproject/quickstart/application/controllers > /home/breen/tmp/zfproject/quickstart/application/models > /home/breen/tmp/zfproject/quickstart/application/data <<< emphasis mine > /home/breen/tmp/zfproject/quickstart/public/index.php > /home/breen/tmp/zfproject/quickstart/application/Bootstrap.php > > [snip] > > > The file > /home/breen/tmp/zfproject/quickstart/application/configs/application.ini > defines the database path as > ... > resources.db.params.dbname = APPLICATION_PATH "/../data/db/guestbook.db" > ... > > > Shouldn't this be APPLICATION_PATH "/data/db/guestbook.db"? Since the data > directory resides in the application directory. Well, in the QuickStart, it's supposed to be as follows: application/ data/ public/ but clearly the OP didn't do that. If that's the case, then they need to change their config accordingly, as you suggest. -- Matthew Weier O'Phinney Project Lead | matthew@... Zend Framework | http://framework.zend.com/ |
|
|
Re: ZF quickstart not working?That's the problem. I moved the data directory up a level (to peer with the application directory) and everything worked.
My error stemmed from an incorrect assumption that the data directory resided in the application directory, rather than in the parent (i.e. quickstart) directory. Looking over the tutorial, I can see how I made the mistake, as the tutorial page, up to the mkdir data/db section, is all in the context of working in the application directory (or one of it's subdirs), and I misread the sentence "Note that the database(s) will be stored in data/db/." within that context. I think it would have helped me to see a complete directory structure graph. The one on the "Create Your Project" is great, but doesn't show the data directory (since it hasn't been created yet). Thanks very much to all for your help in getting me over this doh! error. Breen
|
|
|
Re: ZF quickstart not working?Now I get as far as the bottom of the page Create a Model and Database Table, and when I browse to http://localhost/guestbook, I get the following error:
// application/models/Guestbook.php class Default_Model_Guestbook { protected $_comment; protected $_created; protected $_email; protected $_id; protected $_mapper; public function __construct(array $options = null) { if (is_array($options)) { $this->setOptions($options); } } public function __set($name, $value) { $method = 'set' . $name; if (('mapper' == $name) || !method_exists($this, $method)) { throw new Exception('Invalid guestbook property'); } $this->$method($value); } public function __get($name) { $method = 'get' . $name; if (('mapper' == $name) || !method_exists($this, $method)) { throw new Exception('Invalid guestbook property'); } return $this->$method(); } public function setOptions(array $options) { $methods = get_class_methods($this); foreach ($options as $key => $value) { $method = 'set' . ucfirst($key); if (in_array($method, $methods)) { $this->$method($value); } } return $this; } public function setComment($text) { $this->_comment = (string) $text; return $this; } public function getComment() { return $this->_comment; } public function setEmail($email) { $this->_email = (string) $email; return $this; } public function getEmail() { return $this->_email; } public function setCreated($ts) { $this->_created = $ts; return $this; } public function getCreated() { return $this->_created; } public function setId($id) { $this->_id = (int) $id; return $this; } public function getId() { return $this->_id; } public function setMapper($mapper) { $this->_mapper = $mapper; return $this; } public function getMapper() { if (null === $this->_mapper) { $this->setMapper(new Default_Model_GuestbookMapper()); } return $this->_mapper; } public function save() { $this->getMapper()->save($this); } public function find($id) { $this->getMapper()->find($id, $this); return $this; } public function fetchAll() { return $this->getMapper()->fetchAll(); } } Fatal error: Class 'Default_Model_Guestbook' not found in /home/breen/tmp/zfproject/quickstart/application/controllers/GuestbookController.php on line 15 I've gone over all of the source to verify that I've made no typos, and it is defined as per the tutorial. But it seems to not know where to find it, and I can't figure out why. Thanks very much for all your help. Breen
|
|
|
Re: ZF quickstart not working?Breen Liblong wrote:
> Now I get as far as the bottom of the page Create a Model and Database Table, > and when I browse to http://localhost/guestbook, I get the following error: > > // application/models/Guestbook.php class Default_Model_Guestbook { > protected $_comment; protected $_created; protected $_email; protected $_id; > protected $_mapper; public function __construct(array $options = null) { if [snip] > } } > Fatal error: Class 'Default_Model_Guestbook' not found in > /home/breen/tmp/zfproject/quickstart/application/controllers/GuestbookController.php > on line 15 > Looks like you're missing an opening <?php tag at the start of application/models/Guestbook.php. -- Brenton Alker PHP Developer - Brisbane, Australia http://blog.tekerson.com/ |
|
|
Re: ZF quickstart not working?On Fri, May 15, 2009 at 12:50 AM, Brenton Alker <brenton@...> wrote:
> Breen Liblong wrote: >> Now I get as far as the bottom of the page Create a Model and Database Table, >> and when I browse to http://localhost/guestbook, I get the following error: >> >> // application/models/Guestbook.php class Default_Model_Guestbook { >> protected $_comment; protected $_created; protected $_email; protected $_id; >> protected $_mapper; public function __construct(array $options = null) { if > [snip] >> } } >> Fatal error: Class 'Default_Model_Guestbook' not found in >> /home/breen/tmp/zfproject/quickstart/application/controllers/GuestbookController.php >> on line 15 >> > > Looks like you're missing an opening <?php tag at the start of > application/models/Guestbook.php. > I bet his model is really called Model_Guestbook and not Default_Model_Guestbook. Till |
|
|
Re: ZF quickstart not working?On Fri, May 15, 2009 at 12:59 AM, till <klimpong@...> wrote:
> On Fri, May 15, 2009 at 12:50 AM, Brenton Alker <brenton@...> wrote: >> Breen Liblong wrote: >>> Now I get as far as the bottom of the page Create a Model and Database Table, >>> and when I browse to http://localhost/guestbook, I get the following error: >>> >>> // application/models/Guestbook.php class Default_Model_Guestbook { >>> protected $_comment; protected $_created; protected $_email; protected $_id; >>> protected $_mapper; public function __construct(array $options = null) { if >> [snip] >>> } } >>> Fatal error: Class 'Default_Model_Guestbook' not found in >>> /home/breen/tmp/zfproject/quickstart/application/controllers/GuestbookController.php >>> on line 15 >>> >> >> Looks like you're missing an opening <?php tag at the start of >> application/models/Guestbook.php. >> > > I bet his model is really called Model_Guestbook and not > Default_Model_Guestbook. > Or the autoloader is broken? ;-) |
|
|
Re: ZF quickstart not working?Once again I've victimized myself with copy-paste. The code sample for Guestbook.php on the "Create a Model and Database Table" page is obviously not the complete file, but merely fragment. I suspect the same for other code samples as well (and have ensured that there is a <?php tag at the beginning of all .php files)..
I've made the changes, and no longer get the class not found error, but the page now comes up with no entries below the "Guestbook Entries:" line. Can anyone please help me get past this one? Again, thanks for everyones help. Breen
|
|
|
Re: ZF quickstart not working?-- Breen Liblong <breen.liblong@...> wrote
(on Thursday, 14 May 2009, 04:33 PM -0700): > Once again I've victimized myself with copy-paste. The code sample for > Guestbook.php on the "Create a Model and Database Table" page is obviously > not the complete file, but merely fragment. I suspect the same for other > code samples as well (and have ensured that there is a <?php tag at the > beginning of all .php files).. The <?php is implied in all the examples. Also... every page has a link to download the full, working code for the quick start. You can always take a look in there to see where what you've done differs. > I've made the changes, and no longer get the class not found error, but the > page now comes up with no entries below the "Guestbook Entries:" line. > > Can anyone please help me get past this one? Click the link to add an entry, and start adding some. :) Alternately, re-run the scripts/load.sqlite.php script, with an argument: % php load.sqlite.php --loaddb (doesn't matter what the last argument is; as long as one is present, it will populate the DB with a few test entries.) > Brenton Alker-3 wrote: > > > > Breen Liblong wrote: > >> Now I get as far as the bottom of the page Create a Model and Database > >> Table, > >> and when I browse to http://localhost/guestbook, I get the following > >> error: > >> > >> // application/models/Guestbook.php class Default_Model_Guestbook { > >> protected $_comment; protected $_created; protected $_email; protected > >> $_id; > >> protected $_mapper; public function __construct(array $options = null) { > >> if > > [snip] > >> } } > >> Fatal error: Class 'Default_Model_Guestbook' not found in > >> /home/breen/tmp/zfproject/quickstart/application/controllers/GuestbookController.php > >> on line 15 > >> > > > > Looks like you're missing an opening <?php tag at the start of > > application/models/Guestbook.php. > > > > -- > > > > Brenton Alker > > PHP Developer - Brisbane, Australia > > > > http://blog.tekerson.com/ > > > > > > > > > > -- > View this message in context: http://www.nabble.com/ZF-quickstart-not-working--tp20383454p23550962.html > Sent from the Zend Framework mailing list archive at Nabble.com. > -- Matthew Weier O'Phinney Project Lead | matthew@... Zend Framework | http://framework.zend.com/ |
|
|
Re: ZF quickstart not working?Thank you Matthew. I don't know how I missed it, but I didn't see the prominent links to the source code on any of the pages. I've reconciled the differences and rerun load.sqlite.php, and it's now working. It should be a smooth run through the rest of the tutorial.
Regards, Breen
|
| Free embeddable forum powered by Nabble | Forum Help |