Forum

Error: "Impossible ...
 
Notifications
Clear all

Error: "Impossible to load class id"

5 Posts
2 Users
0 Reactions
2,403 Views
(@numand)
Posts: 5
Active Member
Topic starter
 
[#6346]

Hi,
As a local non-government organization, I am trying to evaluate how ProjeQtOr will meet our expectations. I installed ProjeQtOr version 8.2.3 to our server which runs Ubuntu 16.04.6 LTS as follows;

1. Install required packages:

sudo apt install nginx php-fpm php-mysql php7.0-gd php7.0-imap php7.0-mbstring php7.0-mysql php7.0-xml php7.0-zip mariadb-server mariadb-client

2. Configure MariaDB:

sudo mysql_secure_installation

3. Create DB user and db:

sudo mysqladmin create projeqtor
sudo mysql --user=root --password --batch --silent --execute="create user 'projeci'@'localhost' identified by 'something';"
sudo mysql --user=root --password --batch --silent --execute="grant all privileges on `projeqtor`.* to 'projeci'@'localhost';"
sudo mysqladmin flush-privileges

4. Configure php.ini

/etc/php/7.0/fpm/php.ini:max_input_vars = 4000


/etc/php/7.0/fpm/pool.d/www.conf:;request_terminate_timeout = 0


/etc/php/7.0/fpm/php.ini~:max_execution_time = 30


/etc/php/7.0/fpm/php.ini:memory_limit = 512M


/etc/php/7.0/fpm/php.ini:file_uploads = On

5. Configure nginx:

# Default server configuration
server {
        listen 80 default_server;
        listen [::]:80 default_server;
        server_name _;
        set $base /var/www;
        root $base/projeqtor;
        index index.php;
        error_log /var/www/log/projeqtor/error.log;
        access_log /var/www/log/projeqtor/access.log;
     
        location / {
                try_files $uri $uri/ index.php?$query_string;
        }

       location ~ .php$ {
               # 404
               try_files $fastcgi_script_name =404;

               # default fastcgi_params
               include fastcgi_params;

               # fastcgi settings
               fastcgi_pass                    unix:/var/run/php/php7.0-fpm.sock;
               fastcgi_index                   index.php;
               fastcgi_buffers                 8 16k;
               fastcgi_buffer_size             32k;

               # fastcgi params
               fastcgi_param DOCUMENT_ROOT             $realpath_root;
               fastcgi_param SCRIPT_FILENAME   $realpath_root$fastcgi_script_name;
               fastcgi_param PHP_ADMIN_VALUE   "open_basedir=$base/:/usr/lib/php/:/tmp/";

        }

        # general settings
        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        # robots.txt
                location = /robots.txt {
                log_not_found off;
                access_log off;
        }

        # assets, media
                 location ~* .(?:css(.map)?|js(.map)?|jpe?g|png|gif|ico|cur|heic|webp|tiff?|mp3|m4a|aac|ogg|midi?|wav|mp4|mov|webm|mpe?g|avi|ogv|flv|wmv)$ {
                 expires 7d;
                 access_log off;
        }

        # svg, fonts
                location ~* .(?:svgz?|ttf|ttc|otf|eot|woff2?)$ {
                add_header Access-Control-Allow-Origin "*";
                expires 7d;
                access_log off;
        }

        # gzip
        gzip on;
        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;

}

server {
        listen 80;
        listen [::]:80;
        server_name *._;
        return 301  http://IP$request_uri; 
}

6. Make server root directory, change ownership and extract zip file:

sudo mkdir -p /var/www/log/projector
sudo touch /var/www/log/projeqtor/{access,error}.log
unzip projeqtorV8.2.3.zip -d /var/www/
sudo chown www-data:www-data -R /var/www/projeqtor
sudo chown www-data:www-data -R /var/www/log/projeqtor

7. Restart services and run installation

systemctl restart mysql.service
systemctl restart php7.0-fpm.service
systemctl restart nginx.service

After all these prerequisite steps, I start installation by typing localhost to web browser. I changed default DB user as "projeci" and default DB user password to "something". Installation went flawless but when I try to login as user "admin" with password "admin", it throws an error:

ERROR: An exception occurred at 11:09:22 on 2019-11-05.

When I inspected to problem, I found these lines in ..projeqtor/files/logs/projeqtor_20191105.log:

2019-11-05 11:09:15.589 ** ERROR ** [] EXCEPTION **
2019-11-05 11:09:15.589 ** ERROR ** [] on file '/var/www/projeqtor/model/persistence/SqlElement.php' at line (3059)
2019-11-05 11:09:15.589 ** ERROR ** [] cause = Class 'id' not found
2019-11-05 11:09:15.589 ** ERROR ** []    => #0 /var/www/projeqtor/model/persistence/SqlElement.php (3029) -> getDependantSqlElement()
2019-11-05 11:09:15.589 ** ERROR ** []    => #1 /var/www/projeqtor/model/persistence/SqlElement.php (674) -> getSqlElement()
2019-11-05 11:09:15.590 ** ERROR ** []    => #2 /var/www/projeqtor/model/Parameter.php (28) -> __construct()
2019-11-05 11:09:15.590 ** ERROR ** []    => #3 /var/www/projeqtor/model/Parameter.php (1171) -> __construct()
2019-11-05 11:09:15.590 ** ERROR ** []    => #4 /var/www/projeqtor/model/SSO.php (25) -> getGlobalParameter()
2019-11-05 11:09:15.590 ** ERROR ** []    => #5 /var/www/projeqtor/view/index.php (56) -> isEnabled()
2019-11-05 11:09:22.777 ** ERROR ***** [] Impossible to load class id
=> Not found in ../model/custom/id.php
=> Not found in ../model/id.php
=> Not found in ../model/persistence/id.php

And this function from projeqtor/model/persistence/SqlElement.php is where the error occured (the last line is 3059.nth line)

/**
   * ==========================================================================
   * retrieve single object included in an object from the Database
   *
   * @param $objClass the
   *          name of the class of the included object
   * @return an object
   */
  private function getDependantSqlElement($objClass) {
    $curId = $this->id;
    if (! trim ( $curId )) {
      $curId = null;
    }
    $obj = new $objClass ( null, true );
    $obj->refId = $this->id;
    $obj->refType = get_class ( $this );

There is no id.php file in projeqtor directory. So, why it is looking for it? Could you help me to solve this problem?

P.S.: My native language is not English.


 
Posted : 05 Nov 2019 12H04
(@babynus)
Posts: 14952
Member Admin
 

It seems your php configuration is strange.

if (ucfirst ( $key ) == $key)

retruns true for $key='id'
This is not normal, but I don't know how php config may force this behavior.


 
Posted : 05 Nov 2019 16H42
(@numand)
Posts: 5
Active Member
Topic starter
 

@babynus, thank you for taking time to answer my question.

After reading your answer (while being offline) for several days ago, I tried to change PHP configuration directives in NGINX virtual host configuration, unfortunately, nothing has changed. I get same error whatever I try. Is there a recommended PHP configuration for ProjeQtOr?


 
Posted : 29 Nov 2019 8H35
(@numand)
Posts: 5
Active Member
Topic starter
 

Since I could not solve the error, I asked a question on unix.stackexchange[1]. It turns out that the error stem from ProjeQtOr's not being able to handle Turkish locale. I changed server's locale to C.UTF-8 and manage to see login screen:) I am going to open a bug report for this error.

[1] https://unix.stackexchange.com/questions/554734/running-nginxphp7-0-error-impossible-to-load-class-id-projeqtor


 
Posted : 29 Nov 2019 13H46
(@babynus)
Posts: 14952
Member Admin
 

Issue recorded as Ticket #4338


 
Posted : 04 Dec 2019 13H37
Share:

Scroll to Top