Installing Cocorico - Tuertolin/Linux GitHub Wiki

Installation requirements

https://github.com/Cocolabs-SAS/cocorico/blob/master/doc/installation.md

Apache 2 (or Nginx)

Activate following modules

  1. Installing Apache 2

~$ sudo apt update

~$ sudo apt upgrade

~$ sudo apt-get install apache2

  1. Activate modules

~$ sudo a2enmod headers

~$ sudo a2enmod rewrite

~$ sudo a2enmod ssl

  1. Configure the Virtual Hosts

  2. Install MongoDB

Import the Public Key: ~$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4

Create a list file for Mongo: (Ubuntu 18.04) ~$ echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

Reload local package database ~$ sudo apt-get update

Install Mongo ~$ sudo apt-get install -y mongodb-org

Run MongoDB Community Edition

Start Mongo ~$ sudo service mongod start

User Mongo on console ~$ mongo --host 127.0.0.1:27017

  1. Install PHP MongoDB Driver

On Ubuntu you can just do: sudo apt-get install php-mongodb or the same for specific PHP version: sudo apt-get install php5.6-mongo or sudo apt-get install php7.0-mongodb

I have used: ~$ sudo apt-get install php-mongodb

  1. Install PHP 7.1

~$ sudo apt-get install software-properties-common

~$ sudo add-apt-repository ppa:ondrej/php

~$ sudo apt-get update

~$ sudo apt-get install php7.1

~$ sudo apt-cache search php7.1

  1. Activate modules:
  • curl (>= 7.36)
  • intl
  • fileinfo
  • openssl
  • soap
  • exif
  • mongodb
  • imagick
  • pdo_sqlite
  • pdo_mysql
  • opcache

In order to check the modules that I have activated:

~$ php -m

~$ sudo apt-get install php7.2-curl php7.2-intl php7.2-soap php7.2-sqlite3 php7.2-opcache

~$ sudo apt-get install php-imagick

~$ sudo apt-get install php7.2-gd

~$ sudo apt-get install php7.2-mysql

And last, add the following lines on PHP.ini

Create a phpinfo.php file in order to know where is the PHP.ini file: <?php phpinfo(); ?>

In order to work, we need to install `~$ sudo apt install libapache2-mod-php7.2'

Add the following lines to php.ini:

curl.cainfo = "pathto/cacert.pem" memory_limit = 256M upload_max_filesize = 12M (as cocorico.user_img_max_upload_size) post_max_size = 240M

Set the same php timezone to php and php-cli php.ini file:

date.timezone = UTC

HOw to find the files:

~$ php -i |grep php\.ini

  1. MySQL

Should I install MySQL? I don't understand. I will install MySQL Server

~$ sudo apt-get install mysql-server

~$ systemctl start mysql

~$ sudo mysql -u root

CREATE DATABASE IF NOT EXISTS CocoricoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, REFERENCES ON CocoricoDB.* TO admin@localhost IDENTIFIED BY 'Password';

Create your service accounts

Enabling APIs on Google: https://cloud.google.com/apis/docs/enable-disable-apis

Application installation

Get project sources

/var/www/cocorico.local$ sudo git clone https://github.com/Cocolabs-SAS/cocorico Symfony

Install composer If you don't have Composer yet, run the following command in the root folder of your Symfony project:

~$ sudo chmod 757 /var/www/cocorico.local/Symfony

~$ cd /var/www/cocorico.local/Symfony

~$ curl -s http://getcomposer.org/installer | php

Install Cocorico dependencies

~$ php composer.phar install

Or to speed up:

php composer.phar install --prefer-dist -vvv Or in case of error with tarball (slower):

php composer.phar install --prefer-source -vvv This command will ask you the values of some of your application parameters. You will find more informations on them in the following chapter.

~$ sudo apt-get install php7.2-mbstring

~$ sudo apt-get install php7.2-xml

~$ sudo apt-get install zip unzip php7.2-zip

https://stackoverflow.com/questions/24351260/how-to-check-which-php-extensions-have-been-enabled-disabled-in-ubuntu-linux-12