Installing php7.0.11 on top of the trusty environment

php
circle.yml

#1

This is what I have got now:
circle.yml


database:
override:
- mysql -u root -p PASS < /home/ubuntu/cemcloud2/config/schema/circle_test.sql

dependencies:
cache_directories:
- vendor

pre:
- sudo apt-get update
- curl -s https://packagecloud.io/install/repositories/circleci/trusty/script.deb.sh | sudo bash
- sudo apt-get install nginx
- sudo add-apt-repository ppa:ondrej/php -y
- sudo apt-get update
- sudo apt-get install php7.0 php7.0-mysql
- sudo a2dismod php5
- sudo a2enmod php7.0
- curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
- sudo apt-get install nodejs
- sudo service mysql stop
- sudo DEBIAN_FRONTEND=noninteractive apt-get remove --purge mysql-server mysql-client mysql-common
- sudo apt-get autoremove
- sudo apt-get autoclean
- sudo rm -rf /var/lib/mysql
- sudo apt-get install software-properties-common
- sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xcbcb082a1bb943db
- sudo add-apt-repository ‘deb [arch=amd64,i386,ppc64el] http://mirror.host.ag/mariadb/repo/10.1/ubuntu trusty main’
- sudo apt-get update
- export DEBIAN_FRONTEND=noninteractive
- sudo debconf-set-selections <<< ‘mariadb-server-10.1 mysql-server/root_password password PASS’
- sudo debconf-set-selections <<< ‘mariadb-server-10.1 mysql-server/root_password_again password PASS’
- sudo apt-get install -y mariadb-server python-mysqldb

# getting selenium
- wget http://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.1.jar
- 'java -jar selenium-server-standalone-2.47.1.jar > /dev/null 2>&1':
      background: true

# start the web server
- 'php app/console server:run --env=test -vvv localhost:8080 > server.log 2>&1':
      background: true

This is what I got before:
circle.yml


machine:
php:
version: 7.0.11

database:
override:
- mysql -u root -p PASS < /home/ubuntu/cemcloud2/config/schema/circle_test.sql

dependencies:
cache_directories:
- vendor

pre:
- sudo apt-get update
- curl -s https://packagecloud.io/install/repositories/circleci/trusty/script.deb.sh | sudo bash
- sudo apt-get install nginx
- curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
- sudo apt-get install nodejs

# getting selenium
- wget http://selenium-release.storage.googleapis.com/2.47/selenium-server-standalone-2.47.1.jar
- 'java -jar selenium-server-standalone-2.47.1.jar > /dev/null 2>&1':
      background: true

# start the web server
- 'php app/console server:run --env=test -vvv localhost:8080 > server.log 2>&1':
      background: true

In the first case (now) it can’t see where php (composer always fails) is located and I think that it is removed by the commands that I added for the installation of the MariaDB.
This is the error that I have in this case:
composer install --no-interaction
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested PHP extension ext-intl * is missing from your system. Install or enable PHP’s intl extension.
Problem 2
- Installation request for aura/intl 3.0.0 -> satisfiable by aura/intl[3.0.0].
- aura/intl 3.0.0 requires php ^5.6|^7.0 -> your PHP version (5.5.9) does not satisfy that requirement.
Problem 3
- Installation request for cakephp/cakephp 3.4.6 -> satisfiable by cakephp/cakephp[3.4.6].
- cakephp/cakephp 3.4.6 requires ext-intl * -> the requested PHP extension intl is missing from your system.
Problem 4
- Installation request for fabpot/goutte v1.0.7 -> satisfiable by fabpot/goutte[v1.0.7].
- fabpot/goutte v1.0.7 requires ext-curl * -> the requested PHP extension curl is missing from your system.
Problem 5

… and so on…

In the second case (before) he can find the php (composer runs), but then circle can’t find the database.
The error that I have in this case is regarding to the database.

I would like to know how to install php 7.0.11. on top of trusty circleCi. Could anyone help me ?


#2