xdxdVSxdxd / HumanEcosystemsv3

Human Ecosystems v3
MIT License
11 stars 6 forks source link

Multiple errors in fresh install #3

Closed theodotos closed 6 years ago

theodotos commented 6 years ago

I am getting these errors when I try to run Human Ecosystemv3:

Warning (2): Declaration of Cake\Chronos\Traits\FrozenTimeTrait::setTime($hours, $minutes, $seconds = 0) should be compatible with DateTime::setTime($hour, $minute, $second = NULL, $microseconds = NULL) [ROOT/vendor/cakephp/chronos/src/MutableDate.php, line 24]

Warning (2): Declaration of Cake\Chronos\Traits\FrozenTimeTrait::setTime($hours, $minutes, $seconds = 0) should be compatible with DateTimeImmutable::setTime($hour, $minute, $second = NULL, $microseconds = NULL) [ROOT/vendor/cakephp/chronos/src/Date.php, line 24]

Warning (2): ini_set() [function.ini-set]: Headers already sent. You cannot change the session module's ini settings at this time [CORE/src/Network/Session.php, line 291]

Warning (2): ini_set() [function.ini-set]: Headers already sent. You cannot change the session module's ini settings at this time [CORE/src/Network/Session.php, line 291]

Warning: ini_set() [function.ini-set]: Headers already sent. You cannot change the session module's ini settings at this time in /var/www/html/example.com/vendor/cakephp/cakephp/src/Network/Session.php on line 291

Fatal error: [RuntimeException] Unable to configure the session, setting session.use_trans_sid failed. #0 /var/www/html/example.com/vendor/cakephp/cakephp/src/Network/Session.php(212): Cake\Network\Session->options(Array) #1 /var/www/html/example.com/vendor/cakephp/cakephp/src/Network/Session.php(119): Cake\Network\Session->__construct(Array) #2 /var/www/html/example.com/vendor/cakephp/cakephp/src/Network/Request.php(184): Cake\Network\Session::create(Array) #3 /var/www/html/example.com/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php(118): Cake\Network\Request::createFromGlobals() #4 /var/www/html/example.com/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php(91): Cake\Error\ExceptionRenderer->_getController() #5 /var/www/html/example.com/vendor/cakephp/cakephp/src/Error/ErrorHandler.php(143): Cake\Error\ExceptionRenderer->__construct(Object(Cake\Error\FatalErrorException)) #6 /var/www/html/example.com/vendor/cakep in /var/www/html/example.com/vendor/cakephp/cakephp/src/Error/ErrorHandler.php on line 156

Warning: ini_set() [function.ini-set]: Headers already sent. You cannot change the session module's ini settings at this time in /var/www/html/example.com/vendor/cakephp/cakephp/src/Network/Session.php on line 291

Fatal error: [RuntimeException] Unable to configure the session, setting session.use_trans_sid failed. #0 /var/www/html/example.com/vendor/cakephp/cakephp/src/Network/Session.php(212): Cake\Network\Session->options(Array) #1 /var/www/html/example.com/vendor/cakephp/cakephp/src/Network/Session.php(119): Cake\Network\Session->__construct(Array) #2 /var/www/html/example.com/vendor/cakephp/cakephp/src/Network/Request.php(184): Cake\Network\Session::create(Array) #3 /var/www/html/example.com/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php(118): Cake\Network\Request::createFromGlobals() #4 /var/www/html/example.com/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php(91): Cake\Error\ExceptionRenderer->_getController() #5 /var/www/html/example.com/vendor/cakephp/cakephp/src/Error/ErrorHandler.php(143): Cake\Error\ExceptionRenderer->__construct(Object(Cake\Error\FatalErrorException)) #6 /var/www/html/example.com/vendor/cakep in /var/www/html/example.com/vendor/cakephp/cakephp/src/Error/ErrorHandler.php on line 156

My system setup:

# lsb_release -a; echo; apache2 -V; echo; mysqld -V; echo; php --version
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04 LTS
Release:        18.04
Codename:       bionic

[Thu May 17 12:57:05.926546 2018] [core:warn] [pid 23374] AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf: DefaultRuntimeDir must be a valid directory, absolute or relative to ServerRoot
Server version: Apache/2.4.29 (Ubuntu)
Server built:   2018-04-25T11:38:24
Server's Module Magic Number: 20120211:68
Server loaded:  APR 1.6.3, APR-UTIL 1.6.1
Compiled using: APR 1.6.3, APR-UTIL 1.6.1
Architecture:   64-bit
Server MPM:     
Server compiled with....
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=256
 -D HTTPD_ROOT="/etc/apache2"
 -D SUEXEC_BIN="/usr/lib/apache2/suexec"
 -D DEFAULT_PIDLOG="/var/run/apache2.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="mime.types"
 -D SERVER_CONFIG_FILE="apache2.conf"

mysqld  Ver 10.1.29-MariaDB-6 for debian-linux-gnu on x86_64 (Ubuntu 18.04)

PHP 7.2.5-0ubuntu0.18.04.1 (cli) (built: May  9 2018 17:21:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.5-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

This is the Playbook I used to set it up:

---
- hosts: humanecosystems.cut.ac.cy
  user: root

  tasks:

  - include_vars: vars/all.yml

  - name: Install Essential Packages
    apt:
      name: "{{ item }}"
      state: present
    with_items:
      - apache2
      - libapache2-mod-php
      - php-mysql
      - php-mbstring
      - php-intl
      - mariadb-server
      - git
      - python-mysqldb

  - name: Git source into Apache DocRoot
    git:
      repo: https://github.com/xdxdVSxdxd/HumanEcosystemsv3.git
      dest: "{{ docroot }}"
      update: no

  - name: Debug Docroot
    debug:
      msg: "Docroot = {{ docroot }}"

  - name: Set Docroot Owneship to www-data
    file:
      path: "{{ docroot }}"
      owner: www-data
      group: www-data
      recurse: yes

  - name: Create Database
    mysql_db:
      name: "{{ mysql_db }}"
      state: present
    notify:
      - Import SQL Schema into Database

  - name: Create Database User
    mysql_user:
      name: "{{ mysql_user }}"
      password: "{{ mysql_pass }}"
      priv: "{{ mysql_db }}.*:ALL"
      state: present

  - name: Create the /etc/apache2/ssl directory
    file:
      path: /etc/apache2/ssl
      state: directory

  - name: Copy configuration files over
    template:
      src: "{{ item.src }}"
      dest: "{{ item.dest }}"
    with_items:
      - { src: templates/app_local.php.j2, dest: "{{ docroot }}/config/app_local.php" }
      - { src: templates/vhost.conf.j2, dest: "/etc/apache2/sites-available/{{ domain }}.conf" }
      - { src: templates/cert.crt.j2, dest: "/etc/apache2/ssl/{{ domain }}.crt" }
      - { src: templates/fullcert.pem.j2, dest: "/etc/apache2/ssl/{{ domain }}.pem" }
      - { src: templates/privkey.key.j2, dest: "/etc/apache2/ssl/{{ domain }}.key" }

  - name: Enable Needed Apache Modules
    apache2_module:
      name: "{{ item }}"
      state: present
    with_items:
      - rewrite
      - ssl

  - name: Disable the default Vhost
    file:
      path: /etc/apache2/sites-enabled/000-default.conf
      state: absent

  - name: Enable the Vhost
    file:
      src: /etc/apache2/sites-available/{{ domain }}.conf
      dest: /etc/apache2/sites-enabled/{{ domain }}.conf
      state: link

  - name: Restart Apache
    service:
      name: apache2
      state: restarted

  handlers:

  - name: Import SQL Schema into Database
    mysql_db:
      name: "{{ mysql_db }}"
      state: import
      target: "{{ docroot }}/DatabaseSchemes/Schema.sql"

Any idea?

xdxdVSxdxd commented 6 years ago

Hi! did you install the Intl extension? http://php.net/manual/en/intl.installation.php

This problem usually happens when it is not installed

let me know

theodotos commented 6 years ago

Hi I have intl and mbstring installed. Also these:

# dpkg-query -f '${binary:Package}\n' -W | grep php
libapache2-mod-php
libapache2-mod-php7.2
php-common
php-intl
php-mbstring
php-mysql
php7.2-cli
php7.2-common
php7.2-intl
php7.2-json
php7.2-mbstring
php7.2-mysql
php7.2-opcache
php7.2-readline

I am getting these errors in the logs and in the website content:

[Fri May 18 04:37:17.659967 2018] [php7:warn] [pid 18104] [client 10.8.64.120:57144] PHP Warning:  ini_set() [<a href='http://php.net/function.ini-set'>function.ini-set</a>]: Headers already sent. You cannot change the session module's ini setting
s at this time in /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Network/Session.php on line 291
[Fri May 18 04:37:17.660120 2018] [php7:error] [pid 18104] [client 10.8.64.120:57144] PHP Fatal error:  [RuntimeException] Unable to configure the session, setting session.use_trans_sid failed.\n#0 /var/www/html/humanecosystems.example.com/vendor/ca
kephp/cakephp/src/Network/Session.php(212): Cake\\Network\\Session->options(Array)\n#1 /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Network/Session.php(119): Cake\\Network\\Session->__construct(Array)\n#2 /var/www/html/humane
cosystems.example.com/vendor/cakephp/cakephp/src/Network/Request.php(184): Cake\\Network\\Session::create(Array)\n#3 /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php(118): Cake\\Network\\Request::createF
romGlobals()\n#4 /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php(91): Cake\\Error\\ExceptionRenderer->_getController()\n#5 /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Error/Erro
rHandler.php(143): Cake\\Error\\ExceptionRenderer->__construct(Object(Cake\\Error\\FatalErrorException))\n#6 /var/www/html/humanecosystems.example.com/vendor/cakep in /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Error/ErrorHand
ler.php on line 156
[Fri May 18 04:37:17.660263 2018] [php7:warn] [pid 18104] [client 10.8.64.120:57144] PHP Warning:  ini_set() [<a href='http://php.net/function.ini-set'>function.ini-set</a>]: Headers already sent. You cannot change the session module's ini setting
s at this time in /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Network/Session.php on line 291
[Fri May 18 04:37:17.660302 2018] [php7:error] [pid 18104] [client 10.8.64.120:57144] PHP Fatal error:  [RuntimeException] Unable to configure the session, setting session.use_trans_sid failed.\n#0 /var/www/html/humanecosystems.example.com/vendor/ca
kephp/cakephp/src/Network/Session.php(212): Cake\\Network\\Session->options(Array)\n#1 /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Network/Session.php(119): Cake\\Network\\Session->__construct(Array)\n#2 /var/www/html/humane
cosystems.example.com/vendor/cakephp/cakephp/src/Network/Request.php(184): Cake\\Network\\Session::create(Array)\n#3 /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php(118): Cake\\Network\\Request::createF
romGlobals()\n#4 /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Error/ExceptionRenderer.php(91): Cake\\Error\\ExceptionRenderer->_getController()\n#5 /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Error/Erro
rHandler.php(143): Cake\\Error\\ExceptionRenderer->__construct(Object(Cake\\Error\\FatalErrorException))\n#6 /var/www/html/humanecosystems.example.com/vendor/cakep in /var/www/html/humanecosystems.example.com/vendor/cakephp/cakephp/src/Error/ErrorHand
ler.php on line 156

Are there any missing dependencies?

theodotos commented 6 years ago

It seems to be a compatibility issue with php7.2. I installed php7.0 and it worked!

Here are the instructions if you want to set this up on Ubuntu 18.04:

# apt -y install software-properties-common
# add-apt-repository ppa:ondrej/php
# apt-get update
# apt-get -y install php7.0 php7.0-intl php7.0-mbstring
# a2dismod php7.2
# a2enmod php7.0
# systemctl restart apache2

Thanks @xdxdVSxdxd !