ProjeQtOr free project management software - Error: "Impossible to load class id" - ProjeQtOr
 

Error: "Impossible to load class id"

More
05 Nov 2019 10:04 - 05 Nov 2019 10:20 #1 by numand
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<br/>  => Not found in ../model/custom/id.php <br/>  => Not found in ../model/id.php <br/>  => Not found in ../model/persistence/id.php <br/>

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.
Last edit: 05 Nov 2019 10:20 by numand. Reason: I added the function where the error occured

Please Connexion or Create an account to join the conversation.

More
05 Nov 2019 14:42 #2 by babynus
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.

Babynus
Administrator of ProjeQtOr web site

Please Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.034 seconds