How to install ioncube loader in xampp

1. Find your PHP version using phpinfo() function. You should need to know the version when you download the ionCube loaders.

 

x86/ppc/sparc packages are for 32 bit systems;
x86-64/ppc64 packages are for 64 bit systems.

 

The Windows non-TS Loaders are for use on a Windows system where a phpinfo() page shows that PHP is built with thread safety disabled.

 

2. Download ionCube loader from: http://www.ionCube.com/loaders.php

Download this version: Windows VC9 (x86) – Windows Installer

 

3. Install ionCube loader to XAMPP at: D:\xampp\htdocs\ioncube

 

4. Open php.ini with in text editor.

The file is located at D:\xampp\apache\bin\ or D:\xampp\php\.
Add the following line before any other zend_extension statement.

zend_extension = “D:\xampp\htdocs\ioncube\ioncube_loader_win_5.3.dll”

And Save this file.

 

5. Run (or restart) XAMPP, and open the following link http://localhost/ioncube/loader-wizard.php

 

6. For security reasons we advise that you remove this Wizard script (loader-wizard.php) from your server now that the ionCube Loader is installed.
Remove this! http://localhost/ioncube/loader-wizard.php

Just done!

 

Note: I prefer to put the “ioncube” folder in “D:\xampp\php” instead of htdocs, if you do so, you should also update the path in php.ini file.

Set up multiple virtual hosts on XAMPP for windows

You just have to update the following files:

X:\xampp\apache\conf\extra\httpd-vhosts.conf

 

First of all,  uncomment the following line to enable name based virtual host on your server’s port 80:

NameVirtualHost *:80

 

Then you can start adding your virtual hosts. The following listing is just a sample, I usually do.I am assuming ,we create a project which should be accessible by entering http://demo-project in your browser’s address bar.

<VirtualHost *>
DocumentRoot “X:/xampp/htdocs”
ServerName localhost
</VirtualHost>

<VirtualHost *>
DocumentRoot “X:/xampp/htdocs/mywebsite/webroot”
ServerName test-project
</VirtualHost>

<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot X:/xampp/htdocs/demo-project/public
ServerName demo-project

<Directory “X:/xampp/htdocs/demo-project/public”>
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

 

Make sure the DocumentRoot exists and matches the Directory and remember the value you set for ServerName.

 

2. Edit your windows hosts file

Now your apache is ready,but you have to tell your system what to do if you enter http://demo-project in your browser.The most simple way to deal this is to update your hosts file you can find it from here.

C:\WINDOWS\system32\drivers\etc

(Path wil be different if windows installed else where)

 

The file is just a simple text file which contains IP-to-hostname mappings. Edit the file with a text editor and append a new line which maps the hostname you specified in apache’s ServerName-directive to 127.0.0.1. You can place it just under the existing one which defines localhost. In the end, your file could look like this:

# some comments

127.0.0.1        localhost
127.0.0.1        test-project
127.0.0.1        demo-project

 

Restart your Apache Server in order to load the new configuration and enjoy 🙂

 

How to change or reset XAMPP MySQL root password?

If you want to reset or change xampp mysql password, or have forgot the password for accessing phpMyAdmin then just follow the below step to reset the password or change the password.

 

You can do this by two methods.

 

Method 1

The easiest way is to use the security console, which you can access at http://localhost/security/
This “console” creates a password for the MySQL user “root” and is adjusting the phpMyAdmin configuration.

http://localhost/security/xamppsecurity.php

 

Method 2

With the “XAMPP Shell” (command prompt) you can also reset the password. Open the shell and execute this command
mysqladmin.exe -u root password newpassword

 

Of course, your password should not be “newpassword”, too. In the next step you must adjust the phpMyAdmin configuration for this new password. In the file “D:\xampp\phpMyAdmin\config.inc.php” change the lines:

[php]
$cfg[‘Servers’][$i][‘user’] = ‘root’;
$cfg[‘Servers’][$i][‘password’] = ”;
[/php]

To:

[php]
$cfg[‘Servers’][$i][‘user’] = ‘root’;
$cfg[‘Servers’][$i][‘password’] = ‘newpassword’;
[/php]

 

Instead in the XAMPP Shell, you can also change the password with phpMyAdmin, and then adjust the phpMyAdmin configuration.

I hope, it will help.

How to use multiple MYSQL databases in a project

If your databases are located on same MySQL server.You don’t need two connections, you can access them both as unique user.

You also don’t need to select a DB. Just use the database-name as prefix when specifying the tables. That’s it.

[php]
<?php

mysql_connect("localhost","username","password") or die(mysql_error());

$query = "SELECT * FROM database1.tablename";

$result = mysql_query($query)or die(mysql_error());

var_dump($result);

$query2 = "SELECT * FROM database2.tablename";

$result2 = mysql_query($query2)or die(mysql_error());

var_dump($result2);

?>
[/php]

Or if you want to select database, you can do

Please note there can only be one active DB at a time, it will work in this way:

[php]
<?php

$conn1 = mysql_connect("localhost","username","password") or die(mysql_error());

$conn2 = mysql_connect("localhost","username","password",true) or die(mysql_error());

mysql_select_db("database1",$conn1);

// tablename is a table of database1

$query = "SELECT * FROM tablename";

$result = mysql_query($query,$conn1);

var_dump($result);

mysql_select_db("database2",$conn2);

// tablename is a table of database2

$query2 = "SELECT * FROM tablename";

$result2 = mysql_query($query2,$conn2);

var_dump($result2);

?>
[/php]

Although there’s no need for 2 connections; you can select both DB’s using the same connection.

You can make multiple calls to mysql_connect(), but if the parameters are the same you need to pass true for the ‘$new_link’ (fourth) parameter, otherwise the same connection is reused.

So then you have to do is

[php]
<?php

$db_conn1 = mysql_connect($hostname, $username, $password);

$db_conn2 = mysql_connect($hostname, $username, $password, true);

mysql_select_db(‘database1’, $db_conn1);

mysql_select_db(‘database2’, $db_conn2);

//Then to query database 1, do

mysql_query(‘select * from tablename’, $db_conn1);

//and for database 2

mysql_query(‘select * from tablename’, $db_conn2);

?>
[/php]

It is used if MySQL server of database is different.

 

Use of Environment variables

Environment variables windows

 

Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer.

 

You can say, It is a dynamic “object” that stores a value, which in turn can be referenced by one or more software programs in Windows (OS). Environment variables help programs know what directory to install files in, where to store temporary files, where to find user profile settings, and many other things.

 

Variable names are NOT case sensitive in Windows OS.

 

Environment variables are dynamic because they can change. The values stored can be changed to match the current system’s setup and design (environment). They can also differ between computer systems because each computer can have a different setup.

 

There are a number of environment variables that get referenced by programs and can come in handy for a computer user to find needed information about their computer environment.

Below is the list of some common and important environment variables.

 

%appdata%
%commonprogramfiles%
%local%
%localappdata%
%programfiles%
%temp%
%userprofile%
%windir%

 

You can get some common information using environment variable quickly.

 

You can quickly access any of the above folders by entering the environment variable in the Windows Run box or Windows Search Box.
e.g: To get into the Application Data folder type %appdata% and then press Enter in the Run box.

 

%appdata%
The %appdata% environment variable contains the directory path to the Application Data folder for your user profile. This folder stores settings and logs, among other things, for various software programs. The settings and logs stored there are specific to your user profile.

 

%commonprogramfiles%
The %commonprogramfiles% environment variable contains the directory path to the Common Files folder, within the main Program Files folder. This folder contains various files for common programs and utilities on a computer, mostly system and services related. The default directory path this variable points to is c:\Program Files\Common Files.

 

%local%
The %local% environment variable points to where the security policies & rules are located for the user’s account, Windows in general, Windows Firewall, Network, and various software programs on the computer. This environment variable is native to Windows 7.

 

%localappdata%
The %localappdata% environment variable contains the directory path to where programs store their temporary files. Common temporary files to be stored here are Desktop Themes, Windows Error Reporting, program caching and Internet browser profiles. This environment variable is native to Windows Vista & Windows 7.

 

%programfiles%
The %programfiles% environment variable contains the directory path to where programs are installed. This directory contains sub-directories for each program, which contain the primary files needed by each program in order to run on a computer. The default directory path this variable points to is c:\Program Files.

 

%temp%
The %temp% environment variable contains the directory path to where temporary files stored. These temp files are often Internet temporary files and other user application temporary files (Microsoft Word, Excel, Outlook, etc.).

 

%userprofile%
The %userprofile% environment variable points to the current logged in user’s profile and the directory where user profile data is stored. It is in this directory that a user can find the following folders: My Documents, My Music, My Pictures, Desktop, and Favorites (Internet Explorer bookmarks).

 

%windir%
The %windir% environment variable points to the Windows directory, where Windows system files are located.The default directory path for most versions of Windows is c:\Windows (for Windows NT 4 and 2000, it is c:\WinNT).