How To Access Remote Amazon RDS With PHPMyAdmin

Amazon Relational Database Service (Amazon RDS) is a web service that makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while managing time-consuming database management tasks, freeing you up to focus on your applications and business.

First of all we need to install PHPMyAdmin in ec2 instance (CentOS, Fedora, Amazon Linux AMI)

Step:1

First we need to enable the RPMforge repository on our CentOS system as PHPMyAdmin is not available in the official CentOS/Fedora/Amazon Linux AMI repositories:

Import the RPMforge GPG key:

# rpm --import  http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

On x86_64 systems:

#  yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

On i386 systems:

# yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

Step:2

PHPMyAdmin can now be installed as follows:

# yum install phpmyadmin

Step:3

Now, we configure PHPMyAdmin. We change the Apache configuration so that PHPMyAdmin allows connections not just from localhost (by commenting out the <Directory “/usr/share/phpmyadmin”> stanza):

vi /etc/httpd/conf.d/phpmyadmin.conf
#
# Web application to manage MySQL
#
 
#<Directory "/usr/share/phpmyadmin">
# Order Deny, Allow
# Deny from all
# Allow from 127.0.0.1
#</Directory>
 
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

Step:4

Next, we change the authentication in PHPMyAdmin from cookie to http: and host from local to RDS host url:

vi /usr/share/phpmyadmin/config.inc.php
[...]
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'http';
[...]
/* Server parameters */
$cfg['Servers'][$i]['host'] = '*******.******.us-east-1.rds.amazonaws.com';

Step:5

Restart Apache service:

# /etc/init.d/httpd restart

Step:6

Now we can browse RDS database.

# http://<IPADDRESS> /phpmyadmin

Or

# http://<Domain name>/phpmyadmin

Advantages Of PHPMyAdmin Over Command line Interface.

  • One of the advantages of using PHPMyAdmin is that it has a user interface and you can run queries within the SQL.
  • It is also used in checking referential integrity in MyISAM tables.
  • One can execute, edit and bookmark any SQL-statement, even batch-queries (This will work only in the latest version of PHPMyAdmin).
  • Multiple MySQL servers can be managed by PHPMyAdmin.
  • One can export data to various formats: CSV, SQL, XML, Excel and more.
  • Using Query-By-Example(QBE), create complex queries automatically connecting required tables.
  • One can Browse, view and drop databases, tables, views, fields and indexes.
  • It supports InnoDB tables and foreign keys.

Also See: How to install and configure Jaspersoft in Linux Server(RHEL/Centos/Fedora)

I hope you will find this useful. Feel free to give your valuable feedback.

If you want to update your traditional IT infrastructure to cloud computing, then you can hire expert cloud engineers from Andolasoft.

The Ultimate Guide To Facebook Login Migration Using PHP SDK (v3.0.0)

Facebook is the world’s largest social network with more than 2 billion monthly active users. There are so many users because it is a convenient way for people to connect with friends. The login process is smooth and simple, which makes it very easy for users to sign up and log in.

That’s why different websites such as blogs, news outlets, businesses, organizations, etc. have been integrating Facebook Login into their website by using Facebook Login API. There are more than 500 million people who log into their apps or websites using the same credentials they use on Facebook. It just makes things easier for them and more importantly, it helps businesses build trust among their users by giving them the option to sign in via their existing Facebook account.

Never miss an update from us. Join 10,000+ marketers and leaders.

If you are doing a migration from v2.2.x to v3.0.0

You Need To Do the Following Changes.

  • Download SDK: https://github.com/facebook/facebook-php-sdk
  • Keep the two classes base_facebook.php and facebook.php with the certificate fb_ca_chain_bundle.crt
  • Include facebook.php in your PHP file.
  • If you’re currently using the PHP SDK (v2.2.x) for authentication, you will recall that the login code looked like this:
include_once("facebook.php"); OR include_once("base_facebook.php");
$facebook = new Facebook(…);
$session = $facebook->getSession();
if ($session) {
// proceed knowing you have a valid user session
} else {
// proceed knowing you require user login and/or authentication
}
  • The login code is now:
include_once("facebook.php");
$facebook = new Facebook(…);
$user = $facebook->getUser();
if ($user) {
// proceed knowing you have a logged in user who's authenticated
} else {
// proceed knowing you require user login and/or authentication
}

I hope you like this post and if you want to get such type of updates then please subscribe to our email. You can also visit our PHP/CakePHP portfolio page to see all our apps developed on PHP or CakePHP platform.

CloudLinux’s Recent Integration of PHP 5.5 Alpha 2 Version

Shared hosting operating system provider CloudLinux has expanded their PHP offerings by declaring the availability of PHP 5.5 Alpha2 version to its PHP selector tool.

With the ability to select PHP versions, PHP selector allows the users to get the latest feature updates

and preferred PHP version like PHP 5.2, 5.3, 5.4, and now, 5.5 Alpha2 from their web hosting control panel. CloudLinux places each individual website in a virtual private server.

Never miss an update from us. Join 10,000+ marketers and leaders.

Each account is then assigned a specific amount of hardware resources and a desirable PHP version, by using the PHP selector tool.

PHP 5.5 Alpha2 version includes new features like the most awaited password hashing API and providing users the ability to use bcrypt along with loop-controlling generators.

Igor Seletskiy the CEO of CloudLinux has expressed that the availability of PHP selector has made it easier to get access to PHP features. He quoted “PHP is possibly the most widely used aspect of any shared web hosting plan.”

Igor Seletskiy also added “Like the rest of the web hosting community, we are excited to start exploring the new features of PHP version 5.5.

However, many hosting companies and their customers would not usually deploy an Alpha version on a large-scale, server-wide basis.

CloudLinux and PHP Selector make it possible for hosting providers to assign individual accounts their own PHP version without affecting other sites on the same hardware.” Integrating such features in CloudLinux has helped PHP development to become easier and more productive

How To Send Files To Remote Server Via SSH In PHP

You may have faced a situation where you need to send server files to a remote server. If you are working on a website that requires remote server access and files regularly, it is impossible to keep on transferring the file every time they are updated.

This means that you cannot keep these files in your local system and need to transfer them to the remote server only when they’re updated. To do this, you will need SSH access to the server so that you can send files securely via SFTP or any other secure file transfer protocol.

Once you learn how to set up SSH access, there are some things that you need to know about how SSH works and how it’s used with different servers.

Never miss an update from us. Join 10,000+ marketers and leaders.

This example describes ‘How to SSH to remote server in PHP and send files from one server to another server using libssh2.’

ssh2_connect() – Connect to a remote server
ssh2_scp_send() – Send a file via SSH
ssh2_exec() – Execute a command on a remote server

Install libssh2 and then install PECL SSH2 extension for PHP.

Example:   

$ip = "192.168.2.101";
$username = "test";
$port = 22;
$public_ssh_key = "/var/www/html/ssh_keys/id_dsa.pub";
$private_ssh_key = "/var/www/html/ssh_keys/id_dsa";
 
if(function_exists("ssh2_connect")) {
$ssh_conn = ssh2_connect($ip, $port);
if($ssh_conn) {
//Validate your username with ssh keys
if(ssh2_auth_pubkey_file($ssh_conn, $username, $public_ssh_key, $private_ssh_key, 'secret')) {
 
// Check file list
$stream = ssh2_exec($ssh_conn, 'ls -l /home/test/');
if($stream) {
stream_set_blocking($stream, true);
while ($buf = fread($stream,4096)) {
flush(); // comment this line
$data.=$buf;
print_r($buf); // comment this line
}
fclose($stream);
}
 
// send file from one server to another
ssh2_scp_send($ssh_conn, '/path/from/file.ext', '/home/test/file.ext', 0777);
 
}
else {
die("SSH validation failed using Username: ".$username." (specify valid SSH keys or check your SSH key path)");
}
}
else {
die("SSH validation failed for IP: ".$ip);
}
}
else {
die("'ssh2_connect()' doesn't exists. Install libssh2 with PECL SSH2 extension");
}

Other commands:

ssh2_sftp() – Initialize SFTP subsystem
ssh2_sftp_mkdir()– Create directory on remote server

$sftp = ssh2_sftp($ssh_conn);
ssh2_sftp_mkdir($sftp, '/var/www/html/test');

ssh2_auth_password()  – Authenticate over SSH using a plain password
ssh2_auth_pubkey_file() – Authenticate using a public key
ssh2_shell() – Request an interactive shell
ssh2_tunnel() – Open a tunnel through a remote server

Why Hire PHP Developers for High Quality Web App Development

PHP is a widely-used Open Source, general-purpose, cross-platform & HTML embedded server-side scripting language, that suits web development.

PHP Framework is a fundamental platform that helps programmers for rapid and effective development. It’s one of the powerful tool which helps to tweak code in a standard configured manner & can be used with many relational database management systems (RDBMS).

Reasons of Choosing PHP scripting language

Simple and Easy To Learn

PHP is one of the easiest scripting language to learn and understandable by developers. The syntax is somewhat similar to Java and C. However, knowledge of HTML is the only prerequisite to code in PHP.

Instant Support

When a developer stuck with any coding issue, there are huge numbers of references, forums and support communities available online and they are free. This is simply because, PHP is very popular, widely used and having the largest user base.

Supports All Major OS

PHP can be run on top of major operating systems such as Windows, Linux, UNIX, Mac OSX and so on.

Free of Cost

PHP is an open source and 100% Free for use by anyone. This cuts down cost of production as well as hosting. For these reasons it enjoys popularity over other expensive scripting languages such as ASP, JSP and others.

Integration

PHP makes developers life easy as it can be integrated easily with any of the systems like MongoDB, Memcache, Pusher and more. More or less PHP applications can cater any verticals such as banking sectors, health/hospital industry, government sector or corporates and so on.

Frameworks

PHP developers can develop robust application within a very short time frame using a variety of frameworks like Symfony, Slim, Silex, Zend and Aiki. Each framework allows you to avail a set of benefits including code reuse, better session management and database access libraries.

Easier to fix problems

It is obvious that the web application development is not free from issues, however with PHP it is comparatively easier to troubleshoot than it’s counterparts. This is because with each request, PHP cleans up and starts over. So issue with one request does not affect another request.

Scalability

Scalability is always in demand be it for databases, hosting, or programming, scalability. PHP is built in such a way that you can easily increase your cluster size with grow of your projects.

Object Oriented

Java and Windows COM objects can be called called from PHP. Also PHP allows to create custom classes which in turn can be borrowed by other classes. This is one of the useful capabilities of PHP.

Speed

PHP does not take lot of system resource and operates much faster than other scripting languages. PHP maintains its speed even if it is used with other software. Since PHP is out for a long time, continuous effort is on to make it even better. As a result of which it is fairly stable compared to it’s counterparts.

While planning anything on CakePHP, you should always choose a reliable company like Andolasoft to handle your work. Get in touch to convert your ideas into app.