• Entries (RSS)
  • Comments (RSS)

Joomla does not support PHP 5.3

Posted by | Posted in OpenSource, Tips and Tricks | Posted on 13-01-2010

Tagged Under : ,

Are you getting these errors in Joomla?

Warning: Parameter 1 to modMainMenuHelper::buildXML() expected to be a reference, value given in /home/xx/public_html/libraries/joomla/cache/handler/callback.php on line 99

or

Warning: Parameter 1 to HTML_content::show() expected to be a reference, value given in /home/xx/public_html/travel/includes/Cache/Lite/Function.php on line 92

Its because Joomla does not support PHP 5.3 or PHP 5.3.1

Just downgrade your PHP version and these errors will go away

CentOS yum update missing dependency error

Posted by | Posted in CentOS, How to, Linux, OpenSource, Tips and Tricks, Tutorials | Posted on 07-08-2009

Tagged Under : ,

If you are using

yum update

on CentOS and getting the following errors

Missing Dependency: /usr/lib/python2.4 is needed by package libxml2-python-2.6.26-2.1.2.7.i386 (installed)
gamin-python-0.1.7-8.el5.i386 from installed has depsolving problems
Missing Dependency: /usr/lib/python2.4 is needed by package gamin-python-0.1.7-8.el5.i386 (installed)
Error: Missing Dependency: /usr/lib/python2.4 is needed by package libxml2-python-2.6.26-2.1.2.7.i386 (installed)
Error: Missing Dependency: /usr/lib/python2.4 is needed by package gamin-python-0.1.7-8.el5.i386 (installed)

Don’t panic, the solution is simple … just run the following command

yum clean all

Then do

yum update

Installing PHP 5.2.6 on CentOS box

Posted by | Posted in CentOS, How to, OpenSource, PHP, Resources, Reviews, Tips and Tricks, Tutorials | Posted on 10-07-2009

Tagged Under : , , , , , , , , ,

If you want to install PHP 5.2.x instead of the PHP 1.5.6 offered with default CentOSPlus repo. Please consider installing the utterramblings repo. Setting up this repo is a breeze … just follow these steps

Read the rest of this entry »

How to Install Apache, PHP and MySQL on CentOS

Posted by | Posted in How to, Linux, OpenSource, PHP, Resources, Tips and Tricks, Tutorials | Posted on 02-07-2009

Tagged Under : , , , , ,

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 upgrading your packages.

Read the rest of this entry »

How to Install Webmin in CentOS

Posted by | Posted in How to, Linux, OpenSource, Resources, Tips and Tricks, Tutorials | Posted on 01-07-2009

Tagged Under : , ,

Earlier, I posted a how-to to Install Webmin on Ubuntu, now im going through the tutorial again but this time for CentOS.

Install dependancies before we proceed to install webmin

yum -y install perl-Net-SSLeay

Download the latest version of webmin

wget http://downloads.sourceforge.net/project/webadmin/webmin/1.500/webmin-1.500-1.noarch.rpm?use_mirror=ignum

Once it is downloaded, install the RPM using the following command

rpm -i webmin-1.500-1.noarch.rpm

No more steps required. Its installed :)
Go to your browser and access the control panel with valid ssh credentials

RSS Feed to Twitter

Posted by | Posted in How to, OpenSource, Reviews, Tutorials | Posted on 17-06-2009

Tagged Under : , , ,

Since twitterfeed.com has not been working good for me so I started looking at alternatives and found this great post about how to do this via PHP

Read RSS Feed Mashup + Twitter = Yummy!

Installing / re-installing and Configuring phpMyAdmin on Ubuntu

Posted by | Posted in How to, Linux, OpenSource, PHP, Resources, Tips and Tricks, Tutorials, Ubuntu | Posted on 17-06-2009

Tagged Under : , , , , ,

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

sudo apt-get install phpmyadmin

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)

sudo nano /etc/apache2/apache2.conf
# better to use the following command instead of the one above
#gksudo gedit /etc/apache2/apache2.conf

Add the following line of code inside apache2.conf:

Include /etc/phpmyadmin/apache.conf

Now restart Apache:

sudo /etc/init.d/apache2 restart

Go to /phpmyadmin/ and login with your mysql username and password.

Creating and Installing crontabs using CodeIgniter

Posted by | Posted in How to, OpenSource, PHP, Resources, Reviews, Tips and Tricks, Tutorials | Posted on 14-05-2009

Tagged Under : , , , , , , , ,

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

  1. CodeIgniter backend
  2. Does not modify any core architecture of CodeIgniter
  3. 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

/**
* @author 	    Asim Zeeshan
* @web         http://www.asim.pk/
* @date		13th May, 2009
* @copyright 	No Copyrights, but please link back in any way
*/

/*
|---------------------------------------------------------------
| CASTING argc AND argv INTO LOCAL VARIABLES
|---------------------------------------------------------------
|
*/
$argc = $_SERVER['argc'];
$argv = $_SERVER['argv'];

// INTERPRETTING INPUT
if ($argc > 1 && isset($argv[1])) {
$_SERVER['PATH_INFO'] 	= $argv[1];
$_SERVER['REQUEST_URI'] = $argv[1];
} else {
$_SERVER['PATH_INFO'] 	= '/crons/index';
$_SERVER['REQUEST_URI'] = '/crons/index';
}

/*
|---------------------------------------------------------------
| PHP SCRIPT EXECUTION TIME ('0' means Unlimited)
|---------------------------------------------------------------
|
*/
set_time_limit(0);

require_once('index.php');

/* End of file test.php */

Now, we need a controller e.g. test so the controller code could be something like this. Please note that normally we do not need to output anything from these controllers since they are doing some background work or sending emails but for the sake of giving an example, I will be output-ing something to elaborate the example.

/**
* @author 	    Asim Zeeshan
* @web         http://www.asim.pk/
* @date		13th May, 2009
* @copyright 	No Copyrights, but please link back in any way
*/</code>

class Test extends Controller {

function __construct()
{
parent::Controller();
}

function index()
{
echo "testing from index \n";
}

function test() {
echo "testing from test \n";
}
}

Now execute crontab on linux command prompt

php /full-path-to-cron-file/cron.php /test/index

Viola! all you need now, is to setup the crontab like you normally do.
This code is not shared under any license so feel free to copy/modify/use it. Please link back to this website / post in any way e.g. direct link, credits etc.

P.S. The examples above user PHP5 constructor, If you need to execute this code on PHP4, please modify the constructors.

Template Library for CodeIgniter, Simple, Fast and Easy!

Posted by | Posted in How to, OpenSource, PHP, Resources, Reviews, Tips and Tricks, Tutorials | Posted on 07-05-2009

Tagged Under : , , , ,

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 if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Template {
	var $template_data = array();

	function set($name, $value) {
		$this->template_data[$name] = $value;
	}

	function load($template = '', $view = '' , $view_data = array(), $return = FALSE) {
		$this->CI =& get_instance();
		$this->set('contents', $this->CI->load->view($view, $view_data, TRUE));
		return $this->CI->load->view($template, $this->template_data, $return);
	}

	// load a default template 'template.php'
	function view($view = '' , $view_data = array(), $return = FALSE) {
		$this->CI =& get_instance();
		$this->set('contents', $this->CI->load->view($view, $view_data, TRUE));
		return $this->CI->load->view('template', $this->template_data, $return);
	}
}

/* End of file Template.php */
/* Location: ./system/application/libraries/Template.php */

So now I use it like

$this->template->view('my_view', $view_data);

instead of

$this->template->load('template', 'my_view', $view_data);

Hope it helps somebody.

Getting Started on CodeIgniter, the lightening fast PHP Framework

Posted by | Posted in OpenSource, PHP, Reviews, Thoughts | Posted on 06-05-2009

Tagged Under : , , , , , , ,

Today, I have started on CodeIgniter, one of the powerful PHP frameworks recommended by Rasmus Lerdorf

CodeIgniter is most often noted for its speed when compared to other PHP frameworks. In a critical take on PHP frameworks in general, PHP creator Rasmus Lerdorf spoke at frOSCon in August 2008, noting that he liked CodeIgniter “because it is faster, lighter and the least like a framework”.

Read more about it here.

So far what I can tell you is that it really is FAST. I have been coding in CakePHP and Zend Framework, but this framework is very fast. Truely speaking I did not felt any difference using it.

I will keep posting about my experience of CodeIgniter.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes