July 2012 archive

Pass command line argument to PHP

The command line arguments are stored in an array in the $_SERVER variables called ‘argv’. Running the command “php index.php test1 test2” and then doing print_r($_SERVER[‘argv’]) would output this: [php] Array ( [0] => index.php [1] => test1 [2] => test2 ) [/php] You can also use $argv, It has return the same value. $argc …

Continue reading

Permanent link to this article: https://blog.openshell.in/2012/07/pass-command-line-argument-to-php/

Segmentation fault with rake db:create in ruby on rails

Whenever we invoke rake db:migrate, getting segmentation fault error. Segmentation fault ruby 1.9.1p430 (2010-08-16 revision 28998) [i386-mingw32] Code Aborted probably a bug in our database connectivity DLL file Place this linmysql.dll file within your ruby/bin folder. If the file exists already, replace that file by this file. Download libmySQL.dll

Permanent link to this article: https://blog.openshell.in/2012/07/segmentation-fault-with-rake-dbcreate-in-ruby-on-rails/