Friday, July 26, 2013

Kohana Framework: My Experience

Hello everyone,

Recently I went for an interview, the job was for a Magento development position.

After the initial screening the interviewer said they will test me on something which not many people use, so that they know I work with a new framework, this was the first time I heard of Kohana framework.

Anyways, the task was to develop this small module in Kohana, which is done.I also thought I should record what I have learnt in last 2 days.

Kohana is an HMVC(Hierarchical model–view–controller) PHP5 framework.

Official website: http://kohanaframework.org/ which has a download link as well. Latest stable version is 3.3.0 'badius' right now.


Installation:

Download the package and extract it where you have your webserver's webroot. There is no requirement of database setup, if your application doesn't require any database then you don't need to set it up ever.

After extraction if you open up the framework folder through your browser like http://localhost/kohana then the framework will provide you with information on setup and if its requirements are fulfilled or not.
If everything is fine then it will ask you to rename / remove the index.php file. If you are at this stage then we are pretty much done with the installation.

Few posts on the net says to play with \kohana\application\config\config.php file for some configuration, believe me the framework has evolved since then and nothing is required as such. Infact in the latest version of Kohana you won't even find a config.php in \kohana\application\config.


Tuesday, July 16, 2013

Magento Instillation Issue - Database server does not support InnoDB storage engine

Hello Everyone,

If you are using WAMP and your get following error message while installing any version of Magento.


' Database server does not support InnoDB storage engine '.


Then do not try to fix this issue by messing with my.ini or my.cnf file, in other word do not change your MySQL configuration.

The issue is with MySQL ver 5.6 and InnoDB storage Engine, no matter what you do it doesn't work. I have spent too much time on it and I know.


The quickest way is to uninstall your current WAMP server and install a WAMP server which is has MySQL server version lower than 5.6 like 5.5.24 and your issue will be resolved for sure.

One thing though once you uninstall you WAMP server the PHP scripts will remain but MySQL DB files may get deleted, so be careful.

Thanx
Anshumaan Bakshi


Monday, July 8, 2013

How to use PHP through CLI (command line interface) on WAMP - Windows


Hello Everyone,

If you have a requirement that you want to execute a PHP script through CLI on windows, then here are few pointers to help you with that.


First we need WAMP on our system.

And then, we need to locate php.exe, which should be in WAMP's directory. Normally at

C:\wamp\bin\php\php5.4.16\php.exe



Now we can run a PHP script from anywhere on a windows system, we just need to run it with the path to the php.exe file.

Like, I open up my command prompt by going to Windows>Run>cmd

I created a simple PHP script like

test.php

<?php
echo 'hello';
?>

Now if I am in the same folder as test.php is then I can run command like

C:\wamp\bin\php\php5.4.16\php.exe   test.php

I will get ' hello ' as the out out.


If I have my PHP script in some other directory then simply add the path to the file. Like

C:\wamp\bin\php\php5.4.16\php.exe   C:\wamp\www\test.php

It will definitely give an output.

Thanx
Anshumaan Bakshi

Thursday, July 4, 2013

Best way to import large .sql files to PHPmyAdmin via WAMP

Hello everyone,

Say you get an error message in PHPmyAdmin as

' Script timeout passed, if you want to finish import, please resubmit same file and import will resume. '

Or you have reached maximum file upload limit.

On WAMP you can use following steps to ensure your .sql files gets through.

  1. Click on the WAMP icon right next to time on your desktop.
  2. Goto PHP > php.ini
  3. php.ini file will open.
  4. Now search for following variables in the file and change the values as given below
    1. post_max_size = 750M
    2. upload_max_filesize = 750M
    3. max_execution_time = 300
    4. max_input_time = 540
    5. memory_limit = 1000M
  5. Save and close the php.ini file.
  6. Restart the WAMP server via the WAMP icon on the system tray, the option is called Restart all Services.
  7. This should import a large .sql file.
What we are doing here is we are increasing the php variables to a larger level, like file size or execution time  etc, so now the PHPmyAdmin is capable enough to import a larger file easily.

In latest version of WAMP it is possible that some of the variables will not be found, but whatever you can find, you should replace it with higher values.

Hope it fixes your issue.

Thanx
Anshumaan Bakshi