Saturday, June 29, 2013

How To Install YII Framework on Windows

Step By Step Guide to Install YII Framework on Windows

Installing YII Framework on Windows

1. Download YII framework on www.yiiframework.com
2. Install XAMPP
3. Put YII framework (rename to YII) on the XAMPP folder. e.g c:/xampp/yii
4. Open System Properties -> Advanced -> Environment Variables -> Edit System Variables (PATH) -> Put YII path into the
system variables. e.g c:/xampp/YII;c:/xampp/php
5. Open CMD
6. Go to c:/xampp/htdocs/
7. Execute "yiic webapp your_app"
8. Automatically your_app will be generated
9. Open localhost/your_app

Yiic will automatically generate your web application.

PS C:\xampp\htdocs> yiic webapp your_app
Create a Web application under 'C:\xampp\htdocs\your_app'? (yes|no) [no]:yes
      mkdir C:/xampp/htdocs/your_app
      mkdir C:/xampp/htdocs/your_app/assets
      mkdir C:/xampp/htdocs/your_app/css
   generate css/bg.gif
   generate css/form.css
   generate css/ie.css
   generate css/main.css
   generate css/print.css
   generate css/screen.css
      mkdir C:/xampp/htdocs/your_app/images
   generate index-test.php
   generate index.php
      mkdir C:/xampp/htdocs/your_app/protected
   generate protected/.htaccess
      mkdir C:/xampp/htdocs/your_app/protected/commands
      mkdir C:/xampp/htdocs/your_app/protected/commands/shell
      mkdir C:/xampp/htdocs/your_app/protected/components
   generate protected/components/Controller.php
   generate protected/components/UserIdentity.php
      mkdir C:/xampp/htdocs/your_app/protected/config
   generate protected/config/console.php
   generate protected/config/main.php
   generate protected/config/test.php
      mkdir C:/xampp/htdocs/your_app/protected/controllers
   generate protected/controllers/SiteController.php
      mkdir C:/xampp/htdocs/your_app/protected/data
   generate protected/data/schema.mysql.sql
   generate protected/data/schema.sqlite.sql
   generate protected/data/testdrive.db
      mkdir C:/xampp/htdocs/your_app/protected/extensions
      mkdir C:/xampp/htdocs/your_app/protected/messages
      mkdir C:/xampp/htdocs/your_app/protected/migrations
      mkdir C:/xampp/htdocs/your_app/protected/models
   generate protected/models/ContactForm.php
   generate protected/models/LoginForm.php
      mkdir C:/xampp/htdocs/your_app/protected/runtime
      mkdir C:/xampp/htdocs/your_app/protected/tests
   generate protected/tests/bootstrap.php
      mkdir C:/xampp/htdocs/your_app/protected/tests/fixtures
      mkdir C:/xampp/htdocs/your_app/protected/tests/functional
   generate protected/tests/functional/SiteTest.php
   generate protected/tests/phpunit.xml
      mkdir C:/xampp/htdocs/your_app/protected/tests/report
      mkdir C:/xampp/htdocs/your_app/protected/tests/unit
   generate protected/tests/WebTestCase.php
      mkdir C:/xampp/htdocs/your_app/protected/views
      mkdir C:/xampp/htdocs/your_app/protected/views/layouts
   generate protected/views/layouts/column1.php
   generate protected/views/layouts/column2.php
   generate protected/views/layouts/main.php
      mkdir C:/xampp/htdocs/your_app/protected/views/site
   generate protected/views/site/contact.php
   generate protected/views/site/error.php
   generate protected/views/site/index.php
   generate protected/views/site/login.php
      mkdir C:/xampp/htdocs/your_app/protected/views/site/pages
   generate protected/views/site/pages/about.php
   generate protected/yiic
   generate protected/yiic.bat
   generate protected/yiic.php
      mkdir C:/xampp/htdocs/your_app/themes
      mkdir C:/xampp/htdocs/your_app/themes/classic
      mkdir C:/xampp/htdocs/your_app/themes/classic/views
   generate themes/classic/views/.htaccess
      mkdir C:/xampp/htdocs/your_app/themes/classic/views/layouts
      mkdir C:/xampp/htdocs/your_app/themes/classic/views/site
      mkdir C:/xampp/htdocs/your_app/themes/classic/views/system

Your application has been created successfully under C:\xampp\htdocs\your_app.

Wednesday, June 26, 2013

How to Startup Tomcat server in MAC

How to Startup/Shutdown Tomcat server in MAC

/Library/tomcat/bin/startup.sh
/Library/tomcat/bin/shutdown.sh

Saturday, June 22, 2013

How to display .gitignore file in netbeans

To display .gitignore file in netbeans simply modify the miscellaneous options in:

Tools->Options->miscellaneous ->Files

And change the Files ignore by the IDE:
From:
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!(htaccess)$).*$

To:
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!(htaccess|gitignore)$).*$

Friday, June 21, 2013

CSS style submit button height

To adjust the text on the submit input button use the following CSS style:

line-height: 2;

Monday, June 3, 2013

Unable to create Git index.lock File Exists

fatal: Unable to create '/Users/username/Sites/testsite/.git/index.lock': File exists.

If no other git process is currently running, this probably means a
git process crashed in this repository earlier. Make sure no other git
process is running and remove the file manually to continue.

Just delete the index.lock file

rm /Users/username/Sites/testsite/.git/index.lock
git pull

Sunday, June 2, 2013

Apache Access Log, Error Log in Mac

is located in

tail - f /var/log/apache2/access_log
tail - f /var/log/apache2/error_log

Friday, May 31, 2013

PHP error - It is not safe to rely on the system's timezone settings

To fix the bellow error:

1. Find you php.ini files
2.  to see your php.ini files- you need to pass in the INFO_GENERAL parameters as without the parameters you will get the same error as phpinfo() will trigger the timezone issue settings
3. Edit your php.ini files and go to

; Defines the default timezone used by the date functions

; http://php.net/date.timezone

;date.timezone =


Change to what ever your time zone is. For a list of php timezone please visit http://id1.php.net/manual/en/timezones.asia.php

; Defines the default timezone used by the date functions

; http://php.net/date.timezone

date.timezone = "Asia/Dubai"


Ps: don't forget to delete the ";"

4. Restart your apache server. if you are using mac use "sudo apachectl restart"


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/Dubai' for 'WIT/7.0/no DST' instead