Dummies guide to LAMP setup on linux :)

Hello everyone,


Recently I came across several nifty apt-get commands that quite handy and if used properly can be a life saver while setting up LAMP stack on your system.


Step 1 : One line LAMP setup on linux -

  1. sudo apt-get install lamp-server^



Step 2 : Setup phpMyadmin to manage your mysql databases -

  1. sudo apt-get install phpmyadmin



Step 3 : Setup xdebug and integrate with php5 installation -

  1. sudo apt-get install php5-xdebug



Step 4 : Setup cURL -

  1. sudo apt-get install php5-curl



After the above command finishes installing curl do the following -

  1. cd /etc/php5/conf.d/
  2. sudo gedit xdebug.ini



After opening the file in gedit, add the following lines at the end of the file then save and close it.

  1. xdebug.remote_enable=On
  2. xdebug.remote_host="localhost"
  3. xdebug.remote_port=9000
  4. xdebug.remote_handler="dbgp"



The following step is helpful for those who later want to integrate andorid SDK, because only Sun JDK is supported when running the android SDK app, is handy if you use it.


Step 5 : Setup sun -

  1. sudo apt-get install sun-java6



Step 6 : Enable Rewrite Module for PHP -

  1. a2enmod rewrite





The above will do a smooth install of a functioning LAMP server on the system :D , comments and queries are always welcomed.


thanks,

faisal ahmed

web application developer
web: http://www.faisalbd.com/
email: thephpx(at)gmail(dot)com

Share

codeigniter: helper function to call library or model function in view

Hi I am back again,

This time with two helper function that lets you call any function from any model or library, given you already have the model or library loaded into the instance.

This one calls a library function with a single parameter being passed.

  1. if(!function_exists(‘call_lib_func’)){
  2.  function call_lib_func($library_name, $function_name, $parameters=null){
  3.   $ci = &get_instance();
  4.   $ci->load->library($library_name);
  5.   return $ci->$library_name->$function_name($parameters);
  6.  }
  7. }

The next one calls a model function with a single parameter being passed.

  1. if(!function_exists(‘call_mod_func’)){
  2.  function call_mod_func($model_name, $function_name, $parameters=null){
  3.   $ci = &get_instance();
  4.   $ci->load->model($model_name);
  5.   return $ci->$model_name->$function_name($parameters);
  6.  }
  7. }

As of now multiple parameter are not yet supported but I will soon post an extension of these two functions that will support multiple parameters. If you choose to use any of these functions feel free to use but a link back to my site is appreciated :)

thanks,

thephpx

Share

thephpx reloaded!

Hello everybody,

I am back at blogging. This is just the starter hope to come-up with some solid posts ASAP!

So, hang-on and keep visiting :)

- thephpx

Share