Archive for September, 2007

Getting started with the Zend Framework

I’ve started playing with the Zend Framework and noticed that there were lots of getting started tutorials for the old versions. Since many of them don’t update or work anymore I’ve decided to write my own getting started version which should get you up to speed with Zend Framework version 1.0.1 in no time.

At first you need to download and install the framework in a seperate directory, you can either choose that it’s available in the include_path using the php.ini file or by setting it up in a folder which will be used only for your application. If you go for the first one edit the php.ini and search for the include_path directive, add the complete path to the library directory from the extracted Zend Framework archive and you should be set, don’t forget to reload Apache!

The second method is slightly harder but it should also be possible when you’re on a shared hosting platform and the provider hasn’t got the framework installed. Extract the archive somewhere outside the web root (this means that it shouldn’t be accessible through the website).

When you set up a new project, the following directory structure is recommended:

- app
    - controllers
    - views
        - scripts
- library (contains the Zend Framework files)
- public_html (or htdocs in other cases - this is the web root)

In the public_html directory create a file called index.php. This will be our bootstrap for the framework. But first we need to get the PHP error reporting to a decent level and make sure to have access to the framework files. Open index.php and add the following; (continue reading…)


Enabling SSL support in cURL

In some occasions the cURL package may be installed but PHP still reports an error saying something that cURL is installed but without SSL support compiled into it. If your server has OpenSSL installed (look for it by issuing the whereis openssl command) you should download and/or recompile the libcurl package with the following commands;

./configure --with-ssl
make
make install

You probably need to be root when doing the last command (make install).

Now, when you restart Apache, PHP should be able to use SSL connections to other sites without any problems!


Copyright © 1996-2010 Re:morse.nl. All rights reserved.
iDream theme by Templates Next | Powered by WordPress