Warning: date() on ZendServer

Apabila Anda menemukan error seperti ini ketika menggunakan fungsi date() :

Warning: date() [function.date]: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Jakarta’ for ‘WIT/7.0/no DST’ instead in /home/toosa/public_html/basicphp/date1.php on line 2

Ini tandanya Zend Server Anda belum terisi dengan benar. Karena itu masuklah ke Administrasi Zend Server, masuk ke Server Setup lalu cari directive date.timezone , isilah sesuai dengan time zone yang Anda inginkan, misalnya Asia/Jakarta.

 

Start Using Zend Framework 1.11

Zend Framework is one of popular PHP Framework which mostly use for enterprise application. So it will be a little bit complex for the beginers. But don’t worry, I am a beginers too :). I assume that your server is the same with mine, it use linux/unix operating system and can be accessed by ssh/telnet. When I wrote this post, I still use ZF ver. 1.11.

Ok then, lets rock !

1. Get Zend Framework and prepare your site based on Zend Framework

We will get the latest zend framework ini minimal configuration , extract and rename it (I choose ZendFramework-1.11.9-minimal) to ZendFramework then place it under public_html directory (or you can place as you like).

# cd /home/username/public_html

# tar -zxvf ZendFramework-1.11.9-minimal.tar.gz

# mv ZendFramework-1.11.9-minimal ZendFramework

We will use Zend Tools which located in ZendFramework/bin/zf.sh, so we need to create an alias. You need to modify /home/username/.bashrc by add the text bellow at the end of file :

alias zf.sh=/home/username/public_html/ZendFramework/bin/zf.sh

After you modify this file, you need to re-login. Now, every time You login, Zend tools is ready to use 🙂

Check your Zend Tools :

# zf.sh show version

Zend Framework Version: 1.11.9

2. Create a ZF project (let say “zfstart”).

# cd /home/username/public_html

# zf.sh create project zfstart

3. Create a symbolic link of your zend library to your project library directory

# cd /home/username/public_html/zfstart/library

# ln -s /home/username/public_html/ZendFramework/library/Zend

4. And finaly you will have zfstart project directory structure bellow:

5. Test your project

http://yourdomain/zfstart/public

Then you should see like this bellow :

Congratulation !