How to Install Apache, PHP and MySQL on CentOS

How to, Linux, OpenSource, PHP, Resources, Tips and Tricks, Tutorials
I have seen people installing Apache, PHP and MySQL from source code on a production server. You should NEVER, NEVER, NEVER install these packages from source on an RPM or DEB based Linux distributions. Did I say “NEVER” enough times to make your realize that it is not a good practice? Installing from source is bad idea; there are many reasons for this but the major one is that you will be spending a lot of time keeping the system updated. If you love installing from source then I would suggest using a different distribution e.g. Gentoo. You can build from source if the package is not available in yum but still, try to use “yum” (or “apt-get” on Ubuntu) because it will save a lot of your time when…
Read More

How to Install Webmin on CentOS

How to, Linux, OpenSource, Resources, Tips and Tricks, Tutorials
Install dependencies before we proceed to install webmin [code][root@testbed ~]# yum -y install perl-Net-SSLeay[/code] Download latest rpm package from Webmin's official website [code][root@testbed ~]# http://www.webmin.com/download/rpm/webmin-current.rpm -O /tmp/webmin.rpm[/code] Once it is downloaded, install the RPM using the following command [code][root@testbed ~]# rpm -i /tmp/webmin.rpm[/code] No more steps required. Its installed :) Go to your browser and access the control panel with valid ssh credentials. Default URL is https://your-ip:10000/ (IF you have not changed the default port)
Read More

Installing / re-installing and Configuring phpMyAdmin on Ubuntu

How to, Linux, OpenSource, PHP, Resources, Tips and Tricks, Tutorials, Ubuntu
phpMyAdmin is a very common and handy tool that most of the developers use. It is available on almost every server. Installing phpMyAdmin on Ubuntu server is even easier, you just need to [sourcecode language="plain"]sudo apt-get install phpmyadmin[/sourcecode] but what if we accidently skip the configuration screen where phpmyadmin makes modifications to apache? Dont worry just do the following Edit Apache's configuration file (assuming you are using apache2) [sourcecode language="plain"]sudo nano /etc/apache2/apache2.conf # better to use the following command instead of the one above #gksudo gedit /etc/apache2/apache2.conf[/sourcecode] Add the following line of code inside apache2.conf: [sourcecode language="plain"]Include /etc/phpmyadmin/apache.conf[/sourcecode] Now restart Apache: [sourcecode language="plain"]sudo /etc/init.d/apache2 restart[/sourcecode] Go to /phpmyadmin/ and login with your mysql username and password.
Read More

How to list Stored Procedures and Functions in MySQL database

How to, Resources, Tips and Tricks, Tutorials
How to check if there are any STORED PROCEDURE in MySQL database? [sourcecode language="sql"]SHOW PROCEDURE STATUS;[/sourcecode] Similarly for MySQL database FUNCTIONS [sourcecode language="sql"]SHOW FUNCTION STATUS;[/sourcecode] But it displays a list of all PROCEDURE and all FUNCTIONS, you can chop down the list by appending [sourcecode language="sql"]## display FUNCTIONS from 'test' db SHOW FUNCTION STATUS WHERE db LIKE ='test';[/sourcecode] Hope it helps somebody. Enjoy!
Read More

Creating and Installing crontabs using CodeIgniter

How to, OpenSource, PHP, Resources, Reviews, Tips and Tricks, Tutorials
Last night, I was trying to get a crontab working in CodeIgniter, since my current project (a personal project) is using CodeIgniter now. I didn't wanted to use the conventional approach of running crontabs and my code seperate. Unfortunately, CodeIgniter does not have support for Crontabs and I didn't wanted to user wget in linux crontab to initiate unwanted requests. I spent some time and came up with a solution. It uses CodeIgniter backend Does not modify any core architecture of CodeIgniter Keeps configuration at one place So enough of the summary and let me show you how its done. Create a file (e.g. cron.php) in the same place as your index.php and system folder. Here is its code [php]/** * @author Asim Zeeshan * @web http://www.asim.pk/ * @date 13th…
Read More

Template Library for CodeIgniter, Simple, Fast and Easy!

How to, OpenSource, PHP, Resources, Reviews, Tips and Tricks, Tutorials
If you have not noticed, I just got started on CodeIgniter. I was really disappointed today when I noticed the lack of a template system in CodeIngiter to skin my little application. They say The Template Parser Class is not a full-blown template parsing solution. We've kept it very lean on purpose in order to maintain maximum performance. Lucky for me, I got a little help here, the library is great and works well for the latest version of CI too best of all its small and does not modify the CI code in anyway. It just uses the already available code to skin the application. Sleak! I made a couple of modifications in the original library, here are my modifications [php]<?php if ( ! defined('BASEPATH')) exit('No direct script access…
Read More