wordpress blog stats

Archive for the ‘Ubuntu (Linux)’ Category

Displaying Errors ON is a good way of dealing with the errors, warning etc., but only when you are running your code on Testing Environment aka Development Environment. But when you are running your code on Live Environment, then it is not suitable to make your errors, warnings, notices etc. ON. As it would make bad impact on the visitors of your website.

How to Display Errors ON for Windows

If you are a Windows user, then you have to modify the php.ini file.

Goto your wamp folder, which would be like:

D:\wamp\bin\apache\apache2.2.6\bin\

And open the file

php.ini

If you are unbable to find the folder or file as mentioned above, or if you are using some other server in Windows, then simply find the php.ini file located under apache folder (and not php folder), and open it in a text editor.

Find the text

display_errors = Off

and replace the text with:

display_errors = On

Save the file, and restart your Apache Server. And the problem is solved.

How to Display Errors ON for Linux (Ubuntu)

If you are a Ubuntu or Linux user, then you have to modify the php.ini file.

Goto your apache folder, which would be like:

/etc/php5/apache2/

And open the file

php.ini

If you are unbable to find the folder or file as mentioned above, then simply find the php.ini file located under apache folder, and open it in a text editor.

Find the text

display_errors = Off

and replace the text with:

display_errors = On

After saving the file, restart your Apache Server with the following command:

sudo /etc/init.d/apache2 restart

And the problem is solved.

If you are still unable to see the PHP errors, following post may be helpful:

PHP Error Reporting Code

Ubuntu Text Search in Command Line (Gnome Terminal)

If you want to search for different text in files or folders, without using any Visual IDE, then Ubuntu provides you a good and easy way to search for the folder or files in Terminal (Gnome Terminal).

How To Search for Files or Folders?

Simply goto the Terminal (gnome-terminal) through:

Applications -> Accessories -> Terminal

and write the following command:

grep -r ‘webtechquery’ *

where webtechquery is the text you want to search in your files.

This will bring the results with the file names, containing all the files which has the text webtechquery.

Mozilla Thunderbird, Free Alternative to Outlook

Mozilla Thunderbird is one of the best alternatives to Microsoft Outlook, for Windows, Linux etc.
Just like Open Office as an alternative to Microsoft Office, you can now move to Mozilla Thunderbird as an alternate to Microsoft Outlook.

Why to use Mozilla Thunderbird ?

  • Its free
  • Its far more light weight than Outlook
  • It supports add-ons, plugins, themes, even calendar for reminders etc.
  • It now supports tabbing, means now you can open your emails in new tabs, instead of new windows.
  • It supports different operating systems like Windows, Linux, Mac OS X etc.
  • It supports feature to import your Outlook settings to Mozilla Thunderbird
  • And many more

Download Thunderbird

Check out the latest version of Thunderbird on its official website:
Thunderbird Official Website

Thunderbird Calendar, Lightning Calendar

Thunderbird also supports Calendar known as Lightning Calendar, which is actually an extension for Thunderbird, you have to install explicitly. Through Lightning Calendar, you will be able to manage your daily schedule tasks or events, directly within Thunderbird.

Check out the following website to download Lightning Calendar or search for it on Mozilla :
Lightning Calendar

You can also sync your Thunderbird Calendar with Google Calendar through Provider for Google Calendar addon. For details on Thunderbird Add-ons, check out the next topic.

Thunderbird Add-ons & Themes

Like Mozilla Firefox add-ons and themes, Mozilla Thunderbird also supports different add-ons and themes to make your Thunderbird more powerful, and advanced.
Check out the Official Mozilla Addons website for Thunderbird:
Thunderbird Addons

Give it a try and you will enjoy using Thunderbird as an alternative to Microsoft Outlook. If you have something to say or want to share your experience, advantages or disadvantages of using Thunderbird, or any other free alternative to Thunderbird, post your comments here.

If you are getting the following error while browsing any website in Windows or Linux (Ubuntu) like:

Fatal error: Call to undefined function curl_init()

then here is a simple and easy solution, for both Windows and Linux (Ubuntu) users.

For Windows

If you are having the error Call to undefined function curl_init() in Windows, then you have to simply modify a line in apache’s php.ini file.

Goto your wamp folder, which would be like:

D:\wamp\bin\apache\apache2.2.6\bin\

And open the file

php.ini

If you are unbable to find the folder of file as mentioned above, or if you are using some other server in Windows, then simply find the php.ini file located under apache folder (and not php folder), and open it in a text editor.

Find the text

extension=php_curl.dll

and remove the semi-colon at the start.

Now that line would look like:

extension=php_curl.dll

(without semi-colon on start)

Save the file, and restart your Apache Server. And the problem is solved.

For Ubuntu (Linux)

If you are having the error Call to undefined function curl_init() in Ubuntu or Linux, then you have to simply install php5-curl to make this problem resolved.

Simply goto:

System -> Administration -> Synaptic Package Manager

And find the package or software as “php5-curl“ or php curl

and install the CURL module for PHP. After successful installation, restart your Apache Server with the following command:

sudo /etc/init.d/apache2 restart

And the problem is solved.

Or

Or goto gnome-terminal, and write the following command:

sudo apt-get install php5-curl

(if php5 is not the latest php version, then find the latest php curl package and install it)

After successful installation, restart your Apache Server with the following command:

sudo /etc/init.d/apache2 restart

And the problem is solved.

If you want to use Google Chrome in Ubuntu (Linux), without Wine etc., then it is a great news for you that Google has announced its Linux Version of Google Chrome. Though it is in Beta right now, but it would still be better to use the Linux made version of Google Chrome, instead of Wine, Chromium etc. (or other if any).

Download Google Chrome for Ubuntu (Linux)

Click on this direct link of Google Chrome, to download and install the Linux version of Google Chrome.

Google Chrome Extensions / Addons

To download the extensions, addons for Google Chrome, visit the following websites:

chromeextensions.org
chrome.google.com/extensions

How to run .chm files in Linux / Ubuntu ?

If you are finding a way to run Microsoft Compiled HTML Help or .chm files in Ubuntu (Linux), then you are on the right place.

How to run .chm files in Ubuntu / Linux ?

Simply goto:

System -> Administration -> Synaptic Package Manager

And find the package or software as “xCHM“.

Install the software, and that’s it.

Or goto gnome-terminal, and write the following command:

sudo apt-get install xchm

Now you are ready to view .chm files in Ubuntu.

Other software for viewing chm files are as follow:

ChmSee

GnoCHM / CHMViewer

If you are getting the following error while browsing any local website in Ubuntu like:

You don’t have permission to access http://localhost on this server files or folders

then you may not be having the full rights to access that folder or file(s). On the other end, you may be accessing the folders and files through the File Browser (while using gnome-terminal command sudo nautilus etc), but while browsing them through any web browser like Firefox etc., you may be getting the permissions error as mentioned:

403 Forbidden

You don’t have permission to access http://localhost on this server (or any of localhost’s subdirectory)

Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.5 with Suhosin-Patch Server at localhost Port 80
etc.

For the solution, simply do the following method to grant yourself and all of the users, including admin, groups and other users, the read, write and execute rights, to stop getting such errors:

Goto Applications -> Accessories -> Terminal

and write the following code:

chmod a+rwx foldername or filename

with full path, for example:

Granting Rights on Folder:

If you are getting such error on the directory:
/var/www/webtechquery/

then the command should be:

chmod a+rwx /var/www/webtechquery/
or
chmod a+rwx /var/www/webtechquery/*

Granting Rights on File:

If you want to grant full rights on files e.g. abc.php, then the command should be:

chmod a+rwx /var/www/webtechquery/abc.php

If you want the rights to be granted to only the owner, group or specific user(s), then use the following commands:

For Owner:

chmod o+rwx /var/www/webtechquery/abc.php

For Group:

chmod g+rwx /var/www/webtechquery/abc.php

For User:

chmod u+rwx /var/www/webtechquery/abc.php

where:

o = owner
u = user
g = group

and

r = read
w = write
x = execute

Free PHP IDEs for Ubuntu (Linux)

If you are unable to find any good and free PHP IDE for Ubuntu (Linux) then this blog should help you in finding some.

gEdit

gEdit is a built in software in Ubuntu, which is normally used as a text editor for your text files. But this could also be used for other languages like PHP etc. It has a good interface when talking about PHP, which will show you colorful environment and some other good features.

Some of the gEdit features include:

Syntax highlighting for PHP, HTML, CSS, Javascript etc.
Auto indentation
Beautify PHP using PHP_Beautifier
Line numbering
etc.

Geany

If you think gEdit is not the one, and you want some advance features with light weighted software, then Geany could provide you some extra features which gEdit does not have. Projects could easily be managed on Geany, and you can install some other plugins for Geany as well.

Some of the Geany features include:

Syntax highlighting
Code folding
Symbol name auto-completion
Auto-closing of XML and HTML tags
Simple project management
Plugin interface
etc.

Komodo Edit

Komodo Edit is little heavier comparing to gEdit and Geany, but it really has good functionality like Autocompletion, Find in Files, Projects etc.

Some of the Komodo Edit features include:

Autocompletion
Templates
Syntax highlighting
Syntax Checking
Syntax Coloring
Code Snippets
Code Folding
Project explorer
Navigation
Standard Editing Features
Search Highlighting
Editor Hyperlinking
and many more

Some other useful PHP IDEs could be find in the list below:

Quanta Plus

Bluefish

Aptana

NetBeans

Install PHP, MySQL and Apache (LAMP) on Ubuntu (Linux)

If you are new to Ubuntu, and want to install PHP, MySQL and Apache, simply goto the Terminal (gnome-terminal) through:

Applications -> Accessories -> Terminal

and write the following commands:

1. Apache HTTP Server:

sudo apt-get install apache2

To start the Apache server, you have to write:
sudo /etc/init.d/apache2 start

To stop the Apache server, write:
sudo /etc/init.d/apache2 stop

To restart, write:
sudo /etc/init.d/apache2 restart

2. PHP 5:

sudo apt-get install php5 libapache2-mod-php5

3. MySQL Server:

sudo apt-get install mysql-server

After these installations, restart the Apache server by typing:
sudo /etc/init.d/apache2 restart

After successful installation of the above mentioned steps, simply write http://localhost/ on your browser, and see if you see the text: It works

Now goto the folder where you have to place your other PHP projects or files i.e. /var/www and change the index.html file to index.php, and by editing it, write some PHP code in it to check if PHP also works in it e.g.

<?php
   echo ' It works on PHP too ' ;
?>

Simple isnt it? Now start working on your different projects with PHP and MySQL on Ubuntu.