ZF-7401: Errors in QuickStart


First, (on the page […]) the script {{scripts/load.sqlite.php}} won't work if ZendFramework is not in the php include path, it will throw fatal error on line

insert following code 

// Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), get_include_path(), )));

before line 

Next, there is a typo in the command of executing script. Now:

Should be:

Now the data will be inserted too.

And the last one, script creates sqlite database file with the rights 600 on *nix, it should be changed to 666 to prevent errors in writing under different users (web server and command line). Fix: after line



If quickstart exists on SVN, I could some help for you by spellcheck, or code format..etc.

Doesn't… fairly well tell you to add it to your include path?

2Dolf Schimmel: First, thank you for your time. Ok, let's look on that page. {quote} Download the latest version of Zend Framework and extract the contents; make a note of where you have done so. Optionally, you can add the path to the library/ subdirectory of the archive to your php.ini's include_path setting. {quote} As you can see there is a word "Optionally". So, as I don't like to change my php.ini without extra need, I skipped this part. Next: {quote} At this point, if you haven't added Zend Framework to your include_path, we recommend either copying or symlinking it into your library/ directory. In either case, you'll want to either recursively copy or symlink the library/Zend/ directory of your Zend Framework installation into the library/ directory of your project. On unix-like systems, that would look like one of the following:

# Symlink:
% cd library; ln -s path/to/ZendFramework/library/Zend .

# Copy:
% cd library; cp -r path/to/ZendFramework/library/Zend .

{quote} So I made symlink and all worked out of the box, as expected, excepting the script load.sqlite.php that relies on the settings in the include_path although this is optional behavior.

This first item (about the include_path) is a duplicate of issue #7091.

To the second issue, I agree "php scripts/load.sqlite.php" needs to be "php scripts/load.sqlite.php --withdata" (note: not "--with-data"). This needs to be fixed in the "do the following:" code sample, but is already fixed in the "You should see output like the following:" section that follows.

2Ryan Schmidt: Thanks, for the answer, I really missed that issue #7091. What about the last enhancement about chmoding rights?

I agree with you about the third and final issue as well. On my Mac OS X system, files are by default created with 644 permissions, not 600 as they were for you, but either way, these are insufficient permissions for the web server to be able to write to the database, if I am the user who created it. Attempting to sign the guestbook results in this message:

An error occurred Application error Exception information: Message: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database

chmodding the guestbook database to 666 as you suggest is one possible fix for this, and is consistent with the existing instructions in the quickstart to chmod the data and data/db directories to 777. I agree it would make sense for scripts/load.sqlite.php to do this chmod for you after it creates the database.

Thank you very much :)

Fixed in ZF website sources; will release with 1.9.2 today