Here i am going to explain about how to install xampp in ubuntu11.10
*) You can download latest xampp from here
*) extract xampp zip
*) Move the extracted lampp folder to /opt directory using the following command.
sudo mv "lampp src path" /opt
*) set permission to that directory
sudo chmod 777 -R /opt/lampp
sudo chmod 644 /opt/lampp/etc/my.cnf
That's all you just install your xampp. start xampp and work
for xampp start use this command
sudo /opt/lampp/./lampp start
for stop xampp use
sudo /opt/lampp/./lampp stop
restart using
sudo /opt/lampp/./lampp restart
Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts
Thursday, December 8, 2011
Sunday, August 21, 2011
How to set time zone using php?
Here we going to see about how to reset php time zone with out config setting changes.
In php we have two way to reset the time zone.
In php we have two way to reset the time zone.
- putenv
- date_default_timezone_set
echo date('y-m-d h:i:s a');
putenv("TZ=America/Chicago");
echo "<br>".date('y-m-d h:i:s a');
date_default_timezone_set('America/New_York');
echo "<br>".date('y-m-d h:i:s a');
Here you can get the list of supported Timezones
Friday, May 27, 2011
PHP difference between echo,print and printf
Echo, print and printf these three are used for printing the text. Here i am going to explain the difference between these three
echo
----
*) it's a construct.
*) allow multiple parameters
*) does not return any value
-----
*) it's also a construct.
*) do not support multiple parameters
*) return true if it success or false if it fail
printf
------
*) it's a function not a construct
*) allow multiple parameters
Friday, May 6, 2011
optimize php code
Here I am going to write about the common steps to optimize php coding
*) Try to avoid using count() in a loop
(ex) for ($i=0;$i<count($array);$i++) {
}
In this above example the count function called in loop, so it's make delay your page load.
so just follow this
for ($i=0,$n=count($array);$i++) {
}
*) echo statement
use ' instead of "
use , instead of .
This two will increase you page load.
*) Try to avoid using count() in a loop
(ex) for ($i=0;$i<count($array);$i++) {
}
In this above example the count function called in loop, so it's make delay your page load.
so just follow this
for ($i=0,$n=count($array);$i++) {
}
*) echo statement
use ' instead of "
use , instead of .
This two will increase you page load.
Friday, March 4, 2011
How to create nested directory using php?
In php mkdir() we can easily create a diretory , here i am going to explain how to create a nested directory using simple php script
<?php
$folder_path = 'tmp/downlaod/2011';
if (!$folder_path) {
echo 'invalid path name!';
exit;
}
if (file_exists("/temp/download")) {
echo "Directory exists.\n";
exit;
}
$folders = explode('/',$folder_path);
$tmp_path = '';
foreach ($folders as $key=>$name) {
$tmp_path.=$name;
if (!file_exists($tmp_path)) {
mkdir($tmp_path,777);
}
$tmp_path.=DIRECTORY_SEPARATOR;
}
?>
using this you can easily create nested directory .
<?php
$folder_path = 'tmp/downlaod/2011';
if (!$folder_path) {
echo 'invalid path name!';
exit;
}
if (file_exists("/temp/download")) {
echo "Directory exists.\n";
exit;
}
$folders = explode('/',$folder_path);
$tmp_path = '';
foreach ($folders as $key=>$name) {
$tmp_path.=$name;
if (!file_exists($tmp_path)) {
mkdir($tmp_path,777);
}
$tmp_path.=DIRECTORY_SEPARATOR;
}
?>
using this you can easily create nested directory .
Sunday, February 27, 2011
How to install joomla1.6?
Last month joomla release new version there 1.6 production version of joomla. Here I am going to explain how to install it in local.
Requirements
------------------
Here the list individual requirements need for joomla1.6 installation.
Here the list individual requirements need for joomla1.6 installation.
*) PHP 5.2+
*) MYSQL 5.0.4+
*) Apache 2.x+
For local installation we can use any one off the following , it easy and quick way to set the joomla requirements.
*) LAMP (Linux)
*) WAMP (Windows) (http://teamtutorials.com/web-development-tutorials/setting-up-a-wamp-server)
*) MAMP (Macintosh)
*) XAMPP (Multi-platform)
For more details about joomla requirements please click here http://www.joomla.org/technical-requirements.html .
Steps to install joomla1.6
--------------------------------
*)Download latest joomla1.6 version
*)Download latest joomla1.6 version
if you sure the above requirements ok with your local then just download the latest joomla version, you can get the current joomla1.6 version from http://joomlacode.org/gf/project/joomla/frs/?action=FrsReleaseBrowse&frs_package_id=5696
*) extract ( unzip) the file
Just extract the downloaded file and rename it as what you want here I am going to use “joomla1.6” to the folder name.
*) copy the extracted folder to your php installed path.
If you use wamp in windows mean just go the installed directory path (ex) E:\wamp\www past it and set the write permission to that folder .
NOTE : don’t forget to start apache
*) start installation
just run this in you browser (http://localhost/joomla1.6/) and give the required details on it.
NOTE: if you get blank page, please view this localhost give blank page
*) After installation just delete/rename the installation folder in joomla1.6.
Now you can enjoy with joomla1.6
Please fell free to post comments.
localhost give blank page?
Here i am going explain how i resolve the blank page issue of my localhost.
This issue due to same port using, wampp use port 80 and another one program also use the same port .
(ex) skype uses that same port 80.here is the steps to fix that.
*) exit wampp
*) open skype go to tools -> connection options -> connections
*) Uncheck the checkbox “use port 80 and 443 as alternative for incoming connections”
*) open skype
*) start wampp and open localhost
Please feel free to post your comments
Subscribe to:
Posts (Atom)