How to install php on AWS EC2 instance with Amazon MySQL RDS On Ubuntu

    Execute this command: (Remove which you don't need)$: sudo apt-get install apache2 libapache2-mod-php5 php5-mysql postfix mysql-client unzip php5-memcache php5-curl memcached php5-gd

    How to install phpmyadmin with php7 on ubuntu 14.04

    Go to directory /usr/share :$ cd /usr/share Download PhpMyAdmin there :$ sudo wget "" Unzip content :$ sudo unzip Rename Directory :$ sudo mv phpMyAdmin- phpmyadmin Give Recursive permission for execution :$ sudo chmod -R 0755 phpmyadmin Add phpmyadmin to apache2 default configuration file :$ sudo vim /etc/apache2/sites-available/000-default.conf Add below lines after DocumentRoot Alias /phpmyadmin "/usr/sha

    How to install Drupal on PHP7 and Upgrade Server on Ubuntu

    Follow these steps:
    Step 1: sudo add-apt-repository ppa:ondrej/php-7.0

    Step 2: sudo apt-get update
    With Apache:
    Step 3: sudo apt-get install php7.0

    Step 4: sudo apt-get install php7.0-mysql

    Step 5: sudo service apache2 restart
    With Nginx PHP-FPM
    Step 3: sudo apt-get install php7.0-fpm

    Step 4: sudo apt-get install php7.0-mysql

    Step 5: sudo nano /etc/nginx/sites-enabled/default

    Change fastcgi_pass unix:/var/run/php5-fpm.sock; to  unix:/var/run/php/php7.0-fpm.sock;

    Step 6: sudo service nginx restart

    How to install LAMP Linux Apache Mysql PHP on ubuntu 14.04 LTS

    To Install LAMP on Ubuntu 14.04 LTS Simply Type these commands Install Apache $: sudo apt-get update $: sudo apt-get install apache2 Install Mysql $: sudo apt-get install mysql-server php5-mysql Secure mysql $: sudo mysql_install_db $: sudo mysql_secure_installation Choose options whatever you need Install PHP $: sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt PHP File Configuration to select from directory $: sudo vi /etc/apache2/mods-enabled/dir.conf and paste DirectoryIndex index.php index.html index.

    How to setup phpmyadmin on website

    To setup phpmyadmin on site upload phpmyadmin from any wamp installation found in www/app directory or you can download phpmyadmin from After uploading create from and go to the directory like this you will be prompted for username and password in this case
    $cfg['Servers'][$i]['auth_type']     = 'cookie';
    if you have to access directly you can add auth_type as
    $cfg['Servers'][$i]['auth_type']     = 'config';
    and add the

    mysql_fetch_array(): supplied argument is not a valid MySQL result resource solved

    To solve the problem of mysql_fetch_array(): supplied argument is not a valid MySQL result resource You can use query like this no resource error then

    = @mysql_query("select pid from portfolio where category=". $cid);
    $pids = array();
    if (
    $count_query) {
      while (
    $count_result = @mysql_fetch_array($count_query)) {
    $pids[] = $count_result['pid'];

    How to remove special characters from string using php?

    To remove special characters from string use preg_replace like this
    = 'this is @ test & Strings';

    $mydata = preg_replace("/[^a-zA-Z0-9s]/", "", $mydata);

    //print $mydata; will output "thisistestStrings"

    How to highlight keywords in search results in php

    You can use the below code with the css to highlight keywords in the search results
    Css Styles:
    <style type="text/css">
    .search_highlight {

    PHP Code to highlight search results
    = <SEARCH KEYWORD>; //Keyword to highlight.
    $searchresults = <RETURNED STRING>; //Result of search.
    preg_replace("|($keywords)|Ui", "<span class='search_highlight'>$1</span>", $searchresults);

    How to detect browser using php

    To detect browser in php follow the steps:
    1. Download the class file Click Here
    2. Create Browser class object and call getBrowser() function.

    include 'Browser.php';
    $getbrowser= new Browser();
    $browser_name = $getbrowser->getBrowser();
    $browser_version = $browser->getVersion();

    //You can use $browser_name and $browser_version in conditions to excute code in specific browsers

    How to increment decrement date in php

    To increment/decrement date in php you can use simple process as follows: <?php $your_date = '2011-05-20'; //You need to increment it by 2 day //Convert to time stamp first $your_date_ts = strtotime($your_date); //Increment By 2 Day $your_date_dt = strtotime('+2 day', $your_date_ts); echo date('Y-m-d', $your_date_dt); //Increment By 2 Week $your_date_tw = strtotime('+2 week', $your_date_ts); echo date('Y-m-d', $your_date_tw); //Similar process is followed for decrement just user -2 day or -2 week in place of +1 day or +1 week //Decrement By 2 Day