PHP Warning: date(): It is not safe to rely on the system’s timezone settings.

On Apache error.log

...PHP Warning:  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 the timezone 'UTC' for now, but please set date.timezone to select your timezone. in D:\\port\\Apache24-2.4.9\\htdocs\\index.html on line 34

Use on of this :
1. Edit php.ini, then restart Apache

; Defines the default timezone used by the date functions
date.timezone = Asia/Jakarta

2. If your php.ini cannot be edit, you can use this function at the beginning of code

date_default_timezone_set('Asia/Jakarta');//or change to whatever timezone you want

3. Edit index.php without edit php.ini

if( ! ini_get('date.timezone') )

4. If you can’t modify php.ini, and don’t want to add a date_default_timezone call, then use gmdate()

<? print(gmdate("Y")); ?>

Integrate Tomcat, Apache, Subversion, WebSvn, SSL on Windows

# WI
# 31-MAY-2010

1. install jdk-6u17-javafx-1_2_1-windows-i586.exe
    -> C:\Program Files (x86)\Java\jdk1.6.0_17\
2. add environment variables
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_17
JRE_HOME =C:\Program Files (x86)\Java\jre6
2. unzip
    -> G:\Tomcat\
3. edit G:\tomcat\conf\server.xml
    => <Connector port=”8123″ protocol=”HTTP/1.1″
4. edit G:\tomcat\conf\tomcat-users.xml
    => <role rolename=”manager”/>
           <user username=”wi” password=”wi” roles=”manager”/>
5. run G:\tomcat\bin\startup.bat
6. try on browser
    -> http://localhost:8123
you should see,
    >> Apache Tomcat logo,
           Apache Foundation banner,
           page with showing text :
           “If you’re seeing this page via a web browser, it means you’ve setup Tomcat successfully. Congratulations!

1. install httpd-2.2.15-win32-x86-openssl-0.9.8m-r2.msi
    -> G:\Apache\
2. input:
    Network Domain = localhost
    Server Name = localhost
    Administrator’s Email Address =
3. try on browser
    -> http://localhost
you should see,
    >> It works!

1. install Setup-Subversion-1.6.6.msi
    -> G:\Subversion\
2. try on command prompt
    -> set path=%PATH%;G:\Subversion\bin
        svn help

Initialize the repository
on command prompt
1. G:
2. G:\>mkdir G:\svnrepos
3. G:\>mkdir G:\svnrepos\repo1
4. svnadmin create G:\svnrepos\repo1

1. copy & from G:\Subversion\bin to G:\Apache\modules
2. copy libdb44.dll & intl3_svn.dll from G:\Subversion\bin to G:\Apache\bin
2. edit G:\Apache\conf\httpd.conf, add these lines
    -> # All SVN directives
Include conf/extra/httpd-svn.conf
3. create new file G:\Apache\conf\extra\httpd-svn.conf
4. edit G:\Apache\conf\extra\httpd-svn.conf, add these lines
    -> # Load Subversion Apache Modules, & from Subversion-1.6.6
          LoadModule dav_module modules/
          LoadModule dav_svn_module modules/
          LoadModule authz_svn_module modules/

          # Enable Subversion
          DAV svn
          # Directory containing all repository for this path
          SVNParentPath G:/svnrepos

5. try on browser
    -> http://localhost/svn/repo1/
you should see,
    >> repo1 – Revision 0: /

1. unzip
    -> G:\PHP\
2. on command prompt
G:\PHP>copy G:\PHP\php.ini-development G:\PHP\php.ini /v
3. edit G:\Apache\conf\httpd.conf, add these lines
    -> # For PHP 5 do something like this:
          LoadModule php5_module “G:/PHP/php5apache2_2.dll”

    -> # Find section, add these lines
          AddType application/x-httpd-php .php
          AddType application/x-httpd-php .phtml
          -> # Find section, modify the line so it like this,
          DirectoryIndex index.html index.html.var index.php

    -> # at the end of the file, add these lines to tell Apache the path to php.ini
          PHPIniDir “G:/PHP”
4. create new file, phpinfo.php in the folder G:\Apache\htdocs\
    -> <?php
5. try on browser
    -> http://localhost/phpinfo.php
you should see text,
    -> PHP Version 5.3.2 and it’s parameter info

1. unzip
    -> G:\WebSVN
2. on command prompt
G:\WebSVN>copy G:\WebSVN\include\distconfig.php G:\WebSVN\include\config.php /v
3. edit G:\WebSVN\include\config.php, add these lines
    -> $config->setSVNCommandPath(‘G:\\Subversion\\bin’);
4. edit G:\Apache\conf\httpd.conf, add these lines
    -> # Find section, add these lines
          Alias /websvn/ “G:/webSVN”

    -> <Directory “G:/WebSVN”>
          AllowOverride None
          Order allow,deny
          Allow from all

5. try on browser
you should see text,
    -> Subversion Repositories…

Setting Password Authentication
1. on command prompt,
    -> G:\mkdir G:\svnrepos\conf
          G:\G:\Apache\bin\htpasswd -c -m           G:\svnrepos\htpasswd harry [enter new password & re-type]
          G:\G:\Apache\bin\htpasswd -m           G:\svnrepos\htpasswd sally [enter new password & re-type]
          G:\G:\Apache\bin\htpasswd -m           G:\svnrepos\htpasswd ross [enter new password & re-type]
          G:\G:\Apache\bin\htpasswd -m           G:\svnrepos\htpasswd rachel [enter new password & re-type]
          G:\G:\Apache\bin\htpasswd -m           G:\svnrepos\htpasswd william [enter new password & re-type]

Enable SSL
1. edit G:\Apache\conf\httpd.conf, find “”, uncomment the line
    -> LoadModule ssl_module modules/


Access to Tomcat server has not been authorized

For the first time, when I try to deploy a project using Netbeans, i got this message,


Deployment error:
Access to Tomcat server has not been authorized. Set the correct username and password with the “manager” role in the Tomcat customizer in the Server Manager.
See the server log for details.
After I googling, the solution,
– edit the content of C:\Program Files\Apache Software Foundation\Apache Tomcat 6.0.18\conf\tomcat-users.xml file.
-make sure you have role = manager and user that have manager role, like this
<role rolename=”manager”/>
<role rolename=”standard”/>
<user username=”admin” password=”pwd” roles=”standard,manager”/>
-save the file and restart Tomcat server


How to install Ruby On Rails running Xampp on Windows (hello world, Ruby!)

Hohoi…i’m so interested to write a post on my struggles to get my first Ruby on Rails work on Windows.
Thanks to internet which provided so many Guru who want to share their knowledge and skills.
Finally, this was a lot simpler than i had figured.
You may install Apache2 on windows or you may use some Apache2 install packages.
I picked XAMPP beside AppServ, Apache2Triad, WAMP just because i like packages included on it.
So here some step that i use,

1. install Xampp from ApacheFriends (,
for a simpler download (
I install Xampp at c:\xampp

2. install Ruby (ruby186-26.exe or new version) from RubyForge ((,
download an easy one-click Ruby installer, a self-contained installer that includes the Ruby language,
dozens of popular extensions, a syntax-highlighting editor and the book “Programming Ruby: The Pragmatic Programmer’s Guide

3. install Rubygem ( or new version) from RubyForge (
tract it and then run ruby setup.rb

4. install Rails

gem update
gem install rails –include-dependencies

The install could take minutes which will show you like this message,
Bulk updating Gem source index for:

If you encounter an error like this,

Updating installed gems…
ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)
getaddrinfo: no address associated with hostname.(SocketError)

then you must make sure you have internet connection
or may be your are behind a firewall.

When you don’t have internet at home or at office, then you will need
to go to a netcafe and download some files separately from rubyforge gems

The following files need to download,
a. actionmailer
b. actionpack
c. actionwebservice
d. activerecord
e. activesupport
f. rails

Next, install it one by one,
gem install activesupport
gem install activerecord
gem install actionwebservice
gem install actionpack
gem install actionmailer
gem install rails

5. create a rails application
i create it at C:\xampp\htdocs\FirstProject, so run
rails -d mysql C:/xampp/htdocs/FirstProject

6. open C:\xampp\apache\config\httpd.conf file in a text editor,
scroll to the bottom and add the following,

Listen 3000
LoadModule rewrite_module modules/

ServerName rails
DocumentRoot “c:/xampp/htdocs/FirstProject/public”
<Directory "c:/xampp/htdocs/FirstProject/public/"

Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi


7. start server with run this command,
cd c:/xampp/htdocs/FirstProject
ruby script\server

8. run the following at the command-line to keep from getting an “Unknown database” error,
rake db:create

10. make sure your connection to mysql can connect with right user and password,
set C:\xampp\htdocs\FirstProject\config\database.yml

11. to use Rails without a database, open C:\xampp\htdocs\FirstProject\config\environment.rb,
find the commented out line that reads,
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
remove the comment and you must remove the Active Record framework

Rails is a MVC (Model View Controller) framework, so all the output will happen in the controllers and views.

12. generate a controller named “hello” with an action “index”
ruby generate controller hello index

If you browsing to http://localhost:3000/hello, you will get
Find me in app/views/hello/index.html.erb

That message occurs because an action after “hello” doesn’t specified,
rails then search the “index” action and a view for this action doesn’t created too.

13. open the controller file at C:\xampp\htdocs\FirstProject\app\controllers\hello_controller.rb

Any public methods in a controller become actions in Rails. Notice the index action.
Add the following method just before end of file,

def world
@greeting = “hello world!”

The “@” sign lets views access the variable.

12. When browse to http://localhost:300/hello/world,
we have error like this,
Template is missing
Missing template hello/world.html.erb in view path C:/xampp/htdocs/FirstProject/app/views

13. “Template” is Rails word for the “View”. So Rails expecting the template at the path listed. Create or edit C:\xampp\htdocs\FirstProject\app\views\hello\world.rhtml, add the following text,

Try again, browse http://localhost:3000/hello/world and voila, “hello world, Ruby!”

Happy Rails developing and if you have any other learning resources that you’d like to share, please leave them in the comments!

OCI.dll could not be loaded in PHP-Apache

I’ve installed XAMP 1.6.6a  and running of apache 2.2.8 and PHP 5.2.5 versions. I also install oracle instant client so i want to connect to oracle via php using oci.  I got this message when i start apache

This application has failed to start because oci.dll was not found. Re-installing the application may fix this problem.

I had try to set these variable


and uncomment the following lines in php.ini file


but error message would not dissapear

Then I copy oci.dll to folder apache\bin and restart apache, it works fine now. But make sure your oci.dll from Oracle 10, older version will not work.

You can test it using php.exe -m, if you can’t find any error or warning and you see oci8 in list then congratulations!! you succeed to setup oracle extension.

If another error message, such as

The procedure entry point OCIStmtPrepare2 could not be located in the dynamic link library OCI.dll,

then copy oci.dll to php directory and restart apache and test again