Monday, March 22, 2010
Thursday, March 11, 2010
Install Drupal with XAMPP in Ubuntu
Hi New Buddies/Developer,
I'm assuming that you already install xampp in ubuntu machine,if not please install xampp in ubuntu machine by following link
Requirments to Install Drupal
1) Please download latest drupal tar from drupal.org
Note I am considering drupal-6.12.tar.gz here,so you can change to latest version.
Install Drupal
Let’s install Drupal by extracting its content to “opt/lampp/htdocs”:
1. Locate the file drupal-6.12.tar.gz.
2. If it’s not on your Desktop, move the file there.
3. Open the Terminal, enter the following command:
sudo tar xvfz Desktop/drupal-6.12.tar.gz -C /opt/lampp/htdocs
1. Let’s rename “drupal-6.12″ folder to a cleaner name, “drupal”.
2. Enter the following command:
sudo mv /opt/lampp/htdocs/drupal-6.12 /opt/lampp/htdocs/drupal
Test Drupal
Okay, we can now verify whether Drupal has installed correctly:
1. Open your web broswer.
2. Enter the following address:
http://localhost/drupal
You should see this page:

Drupal Setup
Create a Database
In this section, we create a new database for Drupal to store data:
1. Open your web browser.
2. Enter the following address:
http://localhost/phpmyadmin/
1. In the Create new database text box, type in a name for your database (I named mine “creativebushido”.)
2. Click the Create button.
Configure Drupal
Having completed the installation of XAMPP, Drupal, and a brand spanking new database, we can finally go ahead and configure Drupal:
1. Open your web browser.
2. Enter the following address:
http://localhost/drupal
1. Click the Install Drupal in English link.
2. You will be likely to ecounter the following page:

Don’t fret! First, we make a copy of default.settings.php and rename it to settings.php.
1. Open the Terminal, enter the following command:
sudo cp /opt/lampp/htdocs/drupal/sites/default/default.settings.php /opt/lampp/htdocs/drupal/sites/default/settings.php
Next, we need to grant permissions to the settings.php file so that it’s writeable:
1. Enter the following command (press Enter after each line):
cd /opt/lampp/htdocs/drupal/sites
sudo chmod a+w default
sudo chmod a+w default/settings.php
That should have solved all the problems! Okay, now you should be able to see the Database configuration page in your browser:

Notice that I have entered a name for my database, the same name I’d used earlier. Make sure you do the same.
Once you clicked the Save and continue button on the Set up database page, you will be directed to the Configure site page, like the picture below:

For security purposes, it tells you to remove write permissions to the settings.php file. Let’s do that:
1. Open the Terminal, enter the following command:
sudo chmod a-w /opt/lampp/htdocs/drupal/sites/default/settings.php
Finally! You are now ready to enter some important informations for your new web site.
Fill out the the required information for the Site information and Administration account sections. Make sure you remember the username and password you’ve entered!

Once all the informations are filled out, click the Save and continue button.
Voila! Give yourself a pat on the back! You have just completed installing Drupal on your computer!

I hope this has been useful. If you have any technical issues, Please feel free to post your error to me.
I'm glad to creativebushido.wordpress.com blogs for to post this blog :)
I'm assuming that you already install xampp in ubuntu machine,if not please install xampp in ubuntu machine by following link
Requirments to Install Drupal
1) Please download latest drupal tar from drupal.org
Note I am considering drupal-6.12.tar.gz here,so you can change to latest version.
Install Drupal
Let’s install Drupal by extracting its content to “opt/lampp/htdocs”:
1. Locate the file drupal-6.12.tar.gz.
2. If it’s not on your Desktop, move the file there.
3. Open the Terminal, enter the following command:
sudo tar xvfz Desktop/drupal-6.12.tar.gz -C /opt/lampp/htdocs
1. Let’s rename “drupal-6.12″ folder to a cleaner name, “drupal”.
2. Enter the following command:
sudo mv /opt/lampp/htdocs/drupal-6.12 /opt/lampp/htdocs/drupal
Test Drupal
Okay, we can now verify whether Drupal has installed correctly:
1. Open your web broswer.
2. Enter the following address:
http://localhost/drupal
You should see this page:

Drupal Setup
Create a Database
In this section, we create a new database for Drupal to store data:
1. Open your web browser.
2. Enter the following address:
http://localhost/phpmyadmin/
1. In the Create new database text box, type in a name for your database (I named mine “creativebushido”.)
2. Click the Create button.
Configure Drupal
Having completed the installation of XAMPP, Drupal, and a brand spanking new database, we can finally go ahead and configure Drupal:
1. Open your web browser.
2. Enter the following address:
http://localhost/drupal
1. Click the Install Drupal in English link.
2. You will be likely to ecounter the following page:

Don’t fret! First, we make a copy of default.settings.php and rename it to settings.php.
1. Open the Terminal, enter the following command:
sudo cp /opt/lampp/htdocs/drupal/sites/default/default.settings.php /opt/lampp/htdocs/drupal/sites/default/settings.php
Next, we need to grant permissions to the settings.php file so that it’s writeable:
1. Enter the following command (press Enter after each line):
cd /opt/lampp/htdocs/drupal/sites
sudo chmod a+w default
sudo chmod a+w default/settings.php
That should have solved all the problems! Okay, now you should be able to see the Database configuration page in your browser:

Notice that I have entered a name for my database, the same name I’d used earlier. Make sure you do the same.
Once you clicked the Save and continue button on the Set up database page, you will be directed to the Configure site page, like the picture below:

For security purposes, it tells you to remove write permissions to the settings.php file. Let’s do that:
1. Open the Terminal, enter the following command:
sudo chmod a-w /opt/lampp/htdocs/drupal/sites/default/settings.php
Finally! You are now ready to enter some important informations for your new web site.
Fill out the the required information for the Site information and Administration account sections. Make sure you remember the username and password you’ve entered!

Once all the informations are filled out, click the Save and continue button.
Voila! Give yourself a pat on the back! You have just completed installing Drupal on your computer!

I hope this has been useful. If you have any technical issues, Please feel free to post your error to me.
I'm glad to creativebushido.wordpress.com blogs for to post this blog :)
Wednesday, March 10, 2010
Deprecate function Problem for Drupal/Joomla in PHP 5.3.x
Hi Developers,
I googled or searched a lot of forums and website to resolve the issue Deprecate Function error when installing Drupal CMS in PHP 5.3.x version but finally a got a forum i.e Click it
Solution Type 1:
Deprecate warning while installing Drupal framework in php 5.3 version.
If you prefer to keep PHP 5.3, you can always suppress the errors. In Drupal's includes/common.inc, find line 620(nearly).
It should be listed as:
if ($errno & (E_ALL ^ E_NOTICE ^ E_DEPRECATED)) {
Replace this line with:
if ($errno & (E_ALL & ~E_NOTICE & ~E_DEPRECATED)) {
After doing above change in include/common.inc drupal folder,check the installing drupal, if you get again error then you need to Change in php.ini file also
It should be listed as:
error_reporting=E_ALL | E_STRICT | E_DEPRICATED
Replace this line with:
error_reporting=E_ALL & ~E_DEPRICATED & ~E_STRICT
After finishing above change in php.ini,Please Restart your Webserver and Check the installation of drupal.
Note that every time you update Drupal you'll have to manually make this change until they finally patch them to deal properly with php 5.3
Solution Type 2:
Note :If you Still get Deprecate Error after changing all above setting, while Installing Drupal in PHP 5.3.x.
I got solution by My Colleague(Innocent )
Remove all above changes and modify following Line no 902 in includes/file.inc in drupal it resolve the deprecate error.
It should be listed as:
elseif ($depth >= $min_depth && ereg($mask, $file)) {
Replace this line with:
elseif ($depth >= $min_depth && @ereg($mask, $file)) {
I googled or searched a lot of forums and website to resolve the issue Deprecate Function error when installing Drupal CMS in PHP 5.3.x version but finally a got a forum i.e Click it
Solution Type 1:
Deprecate warning while installing Drupal framework in php 5.3 version.
If you prefer to keep PHP 5.3, you can always suppress the errors. In Drupal's includes/common.inc, find line 620(nearly).
It should be listed as:
if ($errno & (E_ALL ^ E_NOTICE ^ E_DEPRECATED)) {
Replace this line with:
if ($errno & (E_ALL & ~E_NOTICE & ~E_DEPRECATED)) {
After doing above change in include/common.inc drupal folder,check the installing drupal, if you get again error then you need to Change in php.ini file also
It should be listed as:
error_reporting=E_ALL | E_STRICT | E_DEPRICATED
Replace this line with:
error_reporting=E_ALL & ~E_DEPRICATED & ~E_STRICT
After finishing above change in php.ini,Please Restart your Webserver and Check the installation of drupal.
Note that every time you update Drupal you'll have to manually make this change until they finally patch them to deal properly with php 5.3
Solution Type 2:
Note :If you Still get Deprecate Error after changing all above setting, while Installing Drupal in PHP 5.3.x.
I got solution by My Colleague(Innocent )
Remove all above changes and modify following Line no 902 in includes/file.inc in drupal it resolve the deprecate error.
It should be listed as:
elseif ($depth >= $min_depth && ereg($mask, $file)) {
Replace this line with:
elseif ($depth >= $min_depth && @ereg($mask, $file)) {
Friday, March 5, 2010
Basic Ubuntu OS Command for Working PHP application
Start Up:
When i started working on the ubuntu machine(i.e march 2nd 2010) i am little scared & tensed..but now it seems cool & great... :)
Now i am not providing all command which ubuntu support.
New Buddies like me want to work on ubuntu machine similary to windows machine.
My Problems on Ubuntu & Solution:
Note :When you logged into ubuntu machine your not root user to the machine so you use SUDO command to perform operations(read/write/create/execute).
1)Unable to find terminal?
Ans: Click on Application->system tools->terminal
2)Unable to minimize all windows opened using keyboard?
Ans: Press ctrl+alt+d keys
3)Navigation of windows using keyboard?
Ans: Press alt+Tab keys
4)Unable to create (php,html,js)files etc using vi command in terminal?
Ans: Use Text Editor for create/write/read files and to enable highlighting code in the Text Editor,first open Text Editor and click on the edit menu ->perferences->enable php code
5)Configuration xampp server??
Ans:
XAMPP for Linux Download – http://www.apachefriends.org/en/xampp-linux.html
Pre-Installation
By now, you should have already downloaded the following file:
1. xampp-linux-1.7.1.tar.gz
Note: Unless you know what you’re doing, it’s recommended that you’re using the same files to avoid any confusion. If, for example, when newer versions are released, simply type in the correct file name when installing in the “Install XAMPP”.
Now, this tutorial is done on a Linux system (Ubuntu), not Windows. Remember earlier when I told you the tools I’d use are all free? Well, Ubuntu is an excellent alternative operating system to Windows! Give it a try, you may like it!
Install XAMPP
We install XAMPP by extracting its content to a folder named “opt”:
1. Locate the file xampp-linux-1.7.1.tar.gz you’ve just downloaded.
2. If it’s not on your Desktop, move the file there use cd ~ command Press enter.
3. Open the Terminal, enter the following command:
sudo tar xvfz Desktop/xampp-linux-1.7.1.tar.gz -C /opt
Start XAMPP
You installed XAMPP in the previous section, now it’s time to start it:
1. Open the Terminal, enter the following command:
sudo /opt/lampp/lampp start
You should see the following lines in the terminal if everything is done correctly:
XAMPP: Starting Apache with SSL (and PHP5)…
XAMPP: Starting MySQL…
XAMPP: Starting ProFTPD…
XAMPP for Linux started.
Test XAMPP
Okay, so how do you know if XAMPP is currently active?
1. Open your favourite web broswer.
2. Enter the following address:
http://localhost.
It will open XAMPP Start Up Page.
Ans:
6)Mail Configuration in Ubuntu?
Ans:Install sendmail server in ubuntu machine
7)Execution php files in the XAMPP?
Ans:Use following commands:
[username@localhost ~]$cd / press enter
[username@localhost ~]$cd /opt/lampp/htdocs/ press enter
[username@localhost ~]$sudo mkdir examples press enter
[username@localhost ~]$sudo chmod 777 examples press enter
Now Go to filesystem (root/opt/lampp/htdocs/examples) and create php file(i.e test.php) in the folder.
Next Step:
browser the link http://localhost/examples/test.php
When i started working on the ubuntu machine(i.e march 2nd 2010) i am little scared & tensed..but now it seems cool & great... :)
Now i am not providing all command which ubuntu support.
New Buddies like me want to work on ubuntu machine similary to windows machine.
My Problems on Ubuntu & Solution:
Note :When you logged into ubuntu machine your not root user to the machine so you use SUDO command to perform operations(read/write/create/execute).
1)Unable to find terminal?
Ans: Click on Application->system tools->terminal
2)Unable to minimize all windows opened using keyboard?
Ans: Press ctrl+alt+d keys
3)Navigation of windows using keyboard?
Ans: Press alt+Tab keys
4)Unable to create (php,html,js)files etc using vi command in terminal?
Ans: Use Text Editor for create/write/read files and to enable highlighting code in the Text Editor,first open Text Editor and click on the edit menu ->perferences->enable php code
5)Configuration xampp server??
Ans:
XAMPP for Linux Download – http://www.apachefriends.org/en/xampp-linux.html
Pre-Installation
By now, you should have already downloaded the following file:
1. xampp-linux-1.7.1.tar.gz
Note: Unless you know what you’re doing, it’s recommended that you’re using the same files to avoid any confusion. If, for example, when newer versions are released, simply type in the correct file name when installing in the “Install XAMPP”.
Now, this tutorial is done on a Linux system (Ubuntu), not Windows. Remember earlier when I told you the tools I’d use are all free? Well, Ubuntu is an excellent alternative operating system to Windows! Give it a try, you may like it!
Install XAMPP
We install XAMPP by extracting its content to a folder named “opt”:
1. Locate the file xampp-linux-1.7.1.tar.gz you’ve just downloaded.
2. If it’s not on your Desktop, move the file there use cd ~ command Press enter.
3. Open the Terminal, enter the following command:
sudo tar xvfz Desktop/xampp-linux-1.7.1.tar.gz -C /opt
Start XAMPP
You installed XAMPP in the previous section, now it’s time to start it:
1. Open the Terminal, enter the following command:
sudo /opt/lampp/lampp start
You should see the following lines in the terminal if everything is done correctly:
XAMPP: Starting Apache with SSL (and PHP5)…
XAMPP: Starting MySQL…
XAMPP: Starting ProFTPD…
XAMPP for Linux started.
Test XAMPP
Okay, so how do you know if XAMPP is currently active?
1. Open your favourite web broswer.
2. Enter the following address:
http://localhost.
It will open XAMPP Start Up Page.
Ans:
6)Mail Configuration in Ubuntu?
Ans:Install sendmail server in ubuntu machine
7)Execution php files in the XAMPP?
Ans:Use following commands:
[username@localhost ~]$cd / press enter
[username@localhost ~]$cd /opt/lampp/htdocs/ press enter
[username@localhost ~]$sudo mkdir examples press enter
[username@localhost ~]$sudo chmod 777 examples press enter
Now Go to filesystem (root/opt/lampp/htdocs/examples) and create php file(i.e test.php) in the folder.
Next Step:
browser the link http://localhost/examples/test.php
Thursday, January 21, 2010
Sending Mail using IIS server with PHP
Using mail() function to send email from IIS server:
This is url Read it
This is url Read it
Wednesday, January 20, 2010
Installation PHP&MYSQL in IIS SERVER
TUTORIAL: PHP Application runs on IIS SERVER
There are 3 steps to Configure php,mysql,iis server in windows xp.
Step 1:
Enable IIS Server:
a)If you don't install iis server in windows xp then goto start->settings->controlpanel->Add or Remove Programs->Add/Remove Windows Component and
enable Internet Information Services(IIS) checkbox and proceed installation(need I386 folder in windows xp to complete installation).
b)After successful installation,open IE browser and click http://localhost it will display startup page of iis server.
This is completes IIS server Configuration in Windows.
Step 2:
Configuration PHP in IIS Server:
a)Download latest php zip from this url and extract the zip and place in temporary like (C:\php).
b)Copy php-ini-recommended file and rename to php.ini place it in c:\WINDOWS folder,if php.ini is presented means please take backup and overwrite the file.
c)Make the change extension_dir = "C:\php\ext" in php.ini file.
d)Configure IIS DLL for executing php on iis server.
Do Following thing:--
Start>control panel>administrative tools>Internet Information Service Expand the + buttons on the left side area if any and Right click the label saying default web site. You will get a list of items in the menu and then go to properties section.



Now you can execute PHP code using IIS webserver
Create a file info.php in C:\Inetpub\wwwroot with following code
phpinfo();
?>
Now execute the info.php file in browser using http://localhost/info.php ,then you will observe php configuration in the browser.
Note: Currently You cannot execute Mysql commands in php application.
Step 3:
Install Mysql in php
a)Download MYSQL from this url and install by click on the .exe through wizards.
b)Copy libmysql.dll file and place it in c:\WINDOWS\SYSTEM32 folder.
C)Edit php.ini from c:\WINDOWS folder to enable mysql library to php
Remove ; (mark) for this two dll's
extension=php_mysql.dll
extension=php_mysqli.dll
Now you can execute php+mysql application.
Good Luck
There are 3 steps to Configure php,mysql,iis server in windows xp.
Step 1:
Enable IIS Server:
a)If you don't install iis server in windows xp then goto start->settings->controlpanel->Add or Remove Programs->Add/Remove Windows Component and
enable Internet Information Services(IIS) checkbox and proceed installation(need I386 folder in windows xp to complete installation).
b)After successful installation,open IE browser and click http://localhost it will display startup page of iis server.
This is completes IIS server Configuration in Windows.
Step 2:
Configuration PHP in IIS Server:
a)Download latest php zip from this url and extract the zip and place in temporary like (C:\php).
b)Copy php-ini-recommended file and rename to php.ini place it in c:\WINDOWS folder,if php.ini is presented means please take backup and overwrite the file.
c)Make the change extension_dir = "C:\php\ext" in php.ini file.
d)Configure IIS DLL for executing php on iis server.
Do Following thing:--
Start>control panel>administrative tools>Internet Information Service Expand the + buttons on the left side area if any and Right click the label saying default web site. You will get a list of items in the menu and then go to properties section.



Now you can execute PHP code using IIS webserver
Create a file info.php in C:\Inetpub\wwwroot with following code
phpinfo();
?>
Now execute the info.php file in browser using http://localhost/info.php ,then you will observe php configuration in the browser.
Note: Currently You cannot execute Mysql commands in php application.
Step 3:
Install Mysql in php
a)Download MYSQL from this url and install by click on the .exe through wizards.
b)Copy libmysql.dll file and place it in c:\WINDOWS\SYSTEM32 folder.
C)Edit php.ini from c:\WINDOWS folder to enable mysql library to php
Remove ; (mark) for this two dll's
extension=php_mysql.dll
extension=php_mysqli.dll
Now you can execute php+mysql application.
Good Luck
Monday, January 11, 2010
Module Development In Joomla 1.5x
TUTORIAL FOR COMPONENT
This article will discuss about the basic of module development in Joomla! 1. we are going to create a module which will randomly display the comment from guestbook comonent.
Preparation
For the preparation, you can use this insert statement to register your new module to Joomla! database.
INSERT INTO `jos_modules` (`title`, `ordering`, `position`, `published`, `module`, `showtitle`) VALUES
('Comment', 19, 'left', 1, 'mod_comment', 1);
Write The Code
Developing module is simpler than developing component. For the start, you just need one file to store your PHP code. So, create a new folder called mod_comment under modules folder inside your Joomla! root folder.
Then, create a new file inside your new folder and name it mod_comment.php. With this file, we're going to display a random comment from guestbook including the sender name and the sending date.
Run It
Now, open your Joomla! web, you will got a randomize comment displayed on your module. You can refresh your page to see if it works. You can also manage its placement from the Joomla! administration page.
This article will discuss about the basic of module development in Joomla! 1. we are going to create a module which will randomly display the comment from guestbook comonent.
Preparation
For the preparation, you can use this insert statement to register your new module to Joomla! database.
INSERT INTO `jos_modules` (`title`, `ordering`, `position`, `published`, `module`, `showtitle`) VALUES
('Comment', 19, 'left', 1, 'mod_comment', 1);
Write The Code
Developing module is simpler than developing component. For the start, you just need one file to store your PHP code. So, create a new folder called mod_comment under modules folder inside your Joomla! root folder.
Then, create a new file inside your new folder and name it mod_comment.php. With this file, we're going to display a random comment from guestbook including the sender name and the sending date.
Run It
Now, open your Joomla! web, you will got a randomize comment displayed on your module. You can refresh your page to see if it works. You can also manage its placement from the Joomla! administration page.
Subscribe to:
Posts (Atom)