Posted in Uncategorized

Downgrade PHP7 to PHP 5.6

 

Then I had to downgrade to PHP 5.6
There are 2 ways to do that. Remove PHP 7.0 completely & install PHP 5.6

sudo apt-get remove php7.0*
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php 5.6

Keep both PHP 7.0 & PHP 5.6, switch accordingly

sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php7.0 php5.6 php5.6-mysql php-gettext php5.6-mbstring  libapache2-mod-php5.6 libapache2-mod-php7.0

Now to use PHP7.0 use the following command

sudo a2dismod php5.6 ; sudo a2enmod php7.0 ; sudo service apache2 restart

And to use PHP5.6 use the following

sudo a2dismod php7.0 ; sudo a2enmod php5.6 ; sudo service apache2 restart

That’s it!

Posted in Database Doctrine, Uncategorized

ZF2, Doctrine & Oracle

To do: Setting up Doctrine to use Oracle
So, here we go.

  • I assume you have added Doctrine module, if not refer here
  • Next open your
    config/autoload/local.php

    & add the configuration as follows

    return array(
        'doctrine' => array(
            'connection' => array(
                'orm_default' => array(
                    'driverClass' => 'Doctrine\DBAL\Driver\OCI8\Driver',
                    'params' => array(
                        'host'     => '192.168.4.136',
                        'port'     => '1521',
                        'user'     => 'iamuser',
                        'password' => 'xxxx',
                        'dbname'   => 'mydb',
                        'driver'   => 'oci8',
                        'service'  => true,
                        'servicename'=>'godisgreat'
                    )
                )
            )
        )
       );
    
  • Next, install libiao
    sudo apt-get install libaio1

    Then install the oci8 driver . You can dowload it from Oracle’s site

  • Now, enable it in php.ini. Open it
    sudo vi /etc/php5/apache2/php.ini
    

    & add the extension like

    extension=oci8.so
    
  • Don’t forget to restart apache