RaviTeja.K

Web Developer.

How to install Mysql Client in Ubuntu

Installing Mysql client for php in ubuntu

sudo apt-get update
sudo apt-get install mysql-client php5-mysql

After executing these commands you have to restart your server which executes the php .If you are using apache restart apache or else if you are using nginx and php-fpm restart php-fpm.

How to Start or Stop a AWS ec2 instance in php

1). Installation of AWS-php sdk

There is a autoload file that’s capable of autoloading all of the classes in any of the libraries of aws. To use it, just add the following line to your code’s bootstrap process.

require '/path/to/aws-autoloader.php';

2). Starting an Ec2 Instance

    <?php
    require '/path/to/aws-autoloader.php';

    use Aws\Ec2\Ec2Client;


    //Initiating 
    $client = Ec2Client::factory(array(
        'key'    => 'YOUR_AWS_ACCESS_KEY_ID',
        'secret' => 'YOUR_AWS_SECRET_ACCESS_KEY',
        // OR: 'profile' => 'my_profile',
        'region' => 'YOUR_EC2_INSTANCE_REGION'
    ));

    //Starting
    $result = $client->startInstances(array(
        // InstanceId is required
        'InstanceIds' => array('YOUR_INSTANCE_ID')        
    ));
    ?>
 

3). Stopping an Ec2 Instance

    <?php
    require '/path/to/aws-autoloader.php';

    use Aws\Ec2\Ec2Client;


    //Initiating 
    $client = Ec2Client::factory(array(
        'key'    => 'YOUR_AWS_ACCESS_KEY_ID',
        'secret' => 'YOUR_AWS_SECRET_ACCESS_KEY',
        // OR: 'profile' => 'my_profile',
        'region' => 'YOUR_EC2_INSTANCE_REGION'
    ));

    //Stopping
    $result = $client->stopInstances(array(
        // InstanceIds is required
        'InstanceIds' => array('YOUR_INSTANCE_ID')        
    ));
    ?>
 

Jekyll GUI App Kreator Mockups

Kreator Mockup 1 Kreator Mockup 1 Kreator Mockup 1 Kreator Mockup 1 Kreator Mockup 1