1

Topic: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Hello:
  I recently performed a major OS upgrade in my server (Fedora 10 - 20). I had previously backed up my Labstore files, both the Web platform files; as well as the mySQL databases with dump. After the upgrade, I reconstituted the MySQL databases successfully. I then reinstalled the web interface file in my web server directory like before, but now I can't access the stocks page, not even when I forcibly direct it to the index.php file.
I'd greatly appreciate your help in the matter

Best regards
Pablo

2

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Hi Pablo, sorry about the delayed response. Can you take a look at the suggestions in this forum post? May be one of them will be of help.

3

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Hi Patnaik:
Thanks for the quick reply. I looked at the post you suggested and I tend to agree with skirmantas, I think it is a PHP and maybe an HTTPD issue in the new Fedora version. I am running:
- Fedora release 20 (Heisenbug)
-MySQL Community Server (GPL) 5.6.19
- PHP 5.5.15
- HTTPD Server version: Apache/2.4.10 (Fedora)

  Like I said, I could reimport the MySQL database, the tables and all the data are there. But, I get nothing in the platform, that is, http://www.myserver.xxx/stocks. I get a blank page. Changing permissions on the stocks folder to 777 doesn't help.
Again, I'd greatly appreciate your help, I am quite stumped by this.

4

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Hi Patnaik:
I've been pursuing this issue, still no success. I ran a PHP CodeSniffer analysis to detect incompatibilities between the index and header php files, using a plain vanilla analysis, and another with a standard to check directly for PHP compatibility. Here is the output, I hope it helps.

Best regards
Pablo

1.- phpcs header.php

FILE: /var/www/html/stocks/header.php
--------------------------------------------------------------------------------
FOUND 59 ERROR(S) AND 8 WARNING(S) AFFECTING 35 LINE(S)
--------------------------------------------------------------------------------
   2 | ERROR   | Missing file doc comment
  11 | ERROR   | "include" is a statement not a function; no parentheses are
     |         | required
  11 | ERROR   | File is being unconditionally included; use "require" instead
  19 | ERROR   | Spaces must be used to indent lines; tabs are not allowed
  19 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 1
  21 | ERROR   | Expected "if (...) {\n"; found "if(...){\n"
  21 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found 0
     |         | spaces
  22 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 1
  26 | ERROR   | You must use "/**" style comments for a function comment
  26 | ERROR   | Function name "add_slashes" is prefixed with a package name
     |         | but does not begin with a capital letter
  26 | ERROR   | Opening brace should be on a new line
  33 | WARNING | Line exceeds 85 characters; contains 128 characters
  34 | ERROR   | Expected "if (...) {\n"; found "if(...){\n"
  34 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found 0
     |         | spaces
  35 | ERROR   | Spaces must be used to indent lines; tabs are not allowed
  35 | ERROR   | Line indented incorrectly; expected at least 12 spaces, found
     |         | 9
  36 | ERROR   | Expected "} elseif (...) {\n"; found "}elseif(...){\n"
  36 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found 0
     |         | spaces
  37 | ERROR   | Spaces must be used to indent lines; tabs are not allowed
  37 | ERROR   | Line indented incorrectly; expected at least 12 spaces, found
     |         | 9
  39 | ERROR   | Expected "} else {\n"; found "}\n        else{\n"
  40 | ERROR   | Spaces must be used to indent lines; tabs are not allowed
  40 | ERROR   | Line indented incorrectly; expected at least 12 spaces, found
     |         | 9
  45 | ERROR   | Missing function doc comment
  45 | ERROR   | Function name "strip_slashes" is prefixed with a package name
     |         | but does not begin with a capital letter
  45 | ERROR   | Opening brace should be on a new line
  57 | WARNING | Line exceeds 85 characters; contains 305 characters
  58 | WARNING | Line exceeds 85 characters; contains 251 characters
  61 | ERROR   | Expected "if (...) {\n"; found "if (...)\n{\n"
  61 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found
     |         | newline
  63 | ERROR   | Line indented incorrectly; expected 4 spaces, found 0
  63 | ERROR   | Expected "if (...) {\n"; found "if (...)\n {"
  63 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found
     |         | newline
  64 | ERROR   | Closing brace must be on a line by itself
  65 | ERROR   | Line indented incorrectly; expected 4 spaces, found 2
  65 | ERROR   | Expected "} else {\n"; found "}\n  else {"
  65 | ERROR   | Closing brace must be on a line by itself
  66 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 0
  67 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 0
  68 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 0
  69 | ERROR   | Line indented incorrectly; expected 4 spaces, found 0
  69 | ERROR   | Expected "if (...) {\n"; found "if(...)\n {"
  69 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found
     |         | newline
  70 | ERROR   | Closing brace must be on a line by itself
  71 | ERROR   | Line indented incorrectly; expected 4 spaces, found 1
  71 | ERROR   | Expected "} else {\n"; found "}\n else {"
  71 | ERROR   | Closing brace must be on a line by itself
104 | WARNING | Line exceeds 85 characters; contains 91 characters
119 | WARNING | Line exceeds 85 characters; contains 123 characters
126 | ERROR   | Expected "if (...) {\n"; found "if(...){\n"
126 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found 0
     |         | spaces
127 | ERROR   | Line indented incorrectly; expected 4 spaces, found 1
127 | ERROR   | Expected "if (...) {\n"; found "if(...){"
127 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found 0
     |         | spaces
127 | WARNING | Line exceeds 85 characters; contains 258 characters
134 | ERROR   | Expected "foreach (...) {\n"; found "foreach (...){\n"
135 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 1
135 | WARNING | Line exceeds 85 characters; contains 138 characters
136 | ERROR   | Line indented incorrectly; expected 4 spaces, found 1
136 | ERROR   | Expected "if (...) {\n"; found "if(...){"
136 | ERROR   | There must be a single space between the closing parenthesis
     |         | and the opening brace of a multi-line IF statement; found 0
     |         | spaces
136 | ERROR   | Closing brace must be on a line by itself
136 | WARNING | Line exceeds 85 characters; contains 88 characters
137 | ERROR   | Line indented incorrectly; expected 4 spaces, found 1
137 | ERROR   | Expected "} else {\n"; found "}\n else{"
137 | ERROR   | Closing brace must be on a line by itself
138 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 1
--------------------------------------------------------------------------------

Time: 117 ms, Memory: 2.25Mb

FILE: index.php
--------------------------------------------------------------------------------
FOUND 12 ERROR(S) AND 7 WARNING(S) AFFECTING 16 LINE(S)
--------------------------------------------------------------------------------
  2 | ERROR   | Missing file doc comment
  4 | ERROR   | "include" is a statement not a function; no parentheses are
    |         | required
  4 | ERROR   | File is being unconditionally included; use "require" instead
  8 | WARNING | Line exceeds 85 characters; contains 396 characters
10 | WARNING | Line exceeds 85 characters; contains 209 characters
11 | WARNING | Line exceeds 85 characters; contains 132 characters
16 | ERROR   | Expected "foreach (...) {\n"; found "foreach(...){\n"
17 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 1
18 | WARNING | Line exceeds 85 characters; contains 208 characters
19 | WARNING | Line exceeds 85 characters; contains 153 characters
20 | WARNING | Line exceeds 85 characters; contains 139 characters
22 | WARNING | Line exceeds 85 characters; contains 163 characters
30 | ERROR   | Expected "foreach (...) {\n"; found "foreach(...){\n"
31 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 1
31 | ERROR   | No space found after comma in function call
32 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 1
33 | ERROR   | Line indented incorrectly; expected at least 4 spaces, found 1
39 | ERROR   | "include" is a statement not a function; no parentheses are
    |         | required
39 | ERROR   | File is being unconditionally included; use "require" instead
--------------------------------------------------------------------------------

Time: 68 ms, Memory: 1.75Mb

-------------------------------------------------

2.- phpcs --standard=PHPCompatibility header.php

FILE: /var/www/html/stocks/header.php
--------------------------------------------------------------------------------
FOUND 6 ERROR(S) AND 1 WARNING(S) AFFECTING 6 LINE(S)
--------------------------------------------------------------------------------
19 | WARNING | INI directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and
    |         | forbidden in PHP 5.4.
22 | ERROR   | The use of function set_magic_quotes_runtime is discouraged in
    |         | PHP version 5.3 and forbidden in PHP version 5.4 and forbidden
    |         | in PHP version 5.5
56 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
    |         | instead.
57 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
    |         | instead.
58 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
    |         | instead.
58 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
    |         | instead.
59 | ERROR   | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
    |         | instead.
--------------------------------------------------------------------------------

Time: 84 ms, Memory: 2.00Mb

FILE: index.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
32 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
    |       | instead.
32 | ERROR | Extension 'mysql_' is deprecated since PHP 5.5 - use mysqli
    |       | instead.
--------------------------------------------------------------------------------

Time: 49 ms, Memory: 1.50Mb

5

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Thanks for posting the CodeSniffer results. I will look into it soon to see if I can find the source of the issue.

6

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

OK. There are probably new code syntax issues. I just got feedback from the author of another database program we were using, which also crashed after the upgrade. The issue was resolved adding php to the <? initiation command in all source files.
I look forward to your reply.

7

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

You are right... none of the CodeSniffer warnings/errors are crucial, so I doubt they point to the issue. Also, the LabStoRe PHP files have <?php.

May be LabStoRe is incompatible with PHP 5.5. I have tested it on up to PHP 5.3.3. I will set up PHP 5.5 and test the software.

8

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Thanks. I haven't programmed or debugged in years,  so I greatly appreciate the effort. I look forward to your feedback.

9

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Hi
Getting closer. I did a little fiddling installing some PHP packages, and I can now access the index page. But, when I try to go to the stocks, I get a blank page, and the browser window shows:

http://www.myserver.xxx/stocks/interface_creator/login.php?function=regular&go_to=(http%3A%2F%2Fwww.myserver.xxx%2Fstocks%2Fmodules%2Fchemicals.php)

Any ideas?

10

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

OK. Latest update, I got it up and running, I can access the database again. BUT... I had to leave all authorization options in config.php in 0! (not the best scenario). I'm guessing the check_login.php file is the culprit. WHat do you think?

11

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

I think I have the figured out two possible causes of this issue:

(1) LabStoRe uses the original PHP MySQL API. This API has now been deprecated (PHP 5.5+ versions). Though it is deprecated, it is still functional. However some PHP installers may not install the API. So, depending on the way PHP has been set up, LabStoRe can fail in PHP 5.5 (or even PHP 5.3).

(2) There is some code in one of the LabStoRe's PHP files (interface_creator/business_logic.php) with code that is incompatible with PHP 5.5.

I will fix these issues (especially the latter). In the meantime, consider downloading an updated version of the 'business_logic.php' file to replace the one in 'interface_creator'; the file is at bioinformatics.org/phplabware/downloads/business_logic.php

Perhaps this will fix the issue for now for you until the new version of LabStoRe is released.

12

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Hi:

OK. I installed the new business_logic.php file, and it is now going back into the login page. But, when I input my username and password, I get the following error message (Authorizations are set to : $enable_admin_authentication = 1, $enable_authentication = 1):

[08] Error: during query execution. The query statement was:

SELECT `username`, `md5_password`, `group` FROM `users` WHERE `username` = superuser AND `md5_password` = xxxxxxxxxxxxxxxxxx

The MySQL server responded: Unknown column 'superuser' in 'where clause


Now, if I remove all authorization requirements in config.php (all set to 0), I can access the database and see the list of entries. But, when I click on details, edit or any other option in any entry, I get a popup window with the following error message:

[08] Error: during query execution. The query statement was:

SELECT `enable_insert_table`, `enable_edit_table`, `enable_delete_table`, `enable_details_table` FROM `dadabik_table_list` WHERE `name_table` = chemicals

The MySQL server responded: Unknown column 'chemicals' in 'where clause'

13

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Oh, looking at the MySQL database, there is a dadabik_ table for every table (i.e. dadabik_chemicals for chemicals). I don't remember that from the prior version... but, that may be just me.

14

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Mmmmh... I have a feeling the $sql string created in line 37 of the new business_logic.php is missing quotes after the WHERE command, for username and md5_password.
In MySQL, I could get the info with :
SELECT `username`, `md5_password`, `group` FROM `users` WHERE `username` = "superuser" AND `md5_password` = "xxxxxxxxxxxxxxxxxxxxxxxxxxx";

15

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Thanks for reporting the quote-related issue. I am looking into it and the other fixes and will release a new version of LabStoRe later today.

16

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

I have now released an updated version (1.6.3) of LabStoRe. Please give it a try and see if it solves the issues that you have faced.

The new version, which I have tested with MySQL 5.5 and PHP 5.5, introduces compatibility with PHP that uses only the MySQLi and not the legacy MySQL extension to handle MySQL-related tasks. It also has many minor bug-fixes.

To update your existing LabStoRe setup:

(1) Make a backup copy of the existing LabStoRe software folder.
(2) Replace the content of the existing software folder with the content in the 'labstore' folder in the downloaded LabStoRe.1.6.3.zip file for LabStoRe 1.6.3.
(3) Replace content of the new labstore/interface_creator/uploads folder with that in the old sub-folder
(4) Edit MySQL, URL and authentication settings in labstore/config.php.

17 (edited by pcaviede 2014-09-11 13:57:16)

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Hi:
Thanks for the upgrade, and all the work. I installed the new version, following the new instructions. I can now access the databases and look at the details, the corresponding window opens to show me the information.

Problem: The program doesn't save data modifications, or allow to add new entries. I go through the process of filling in/modifying a record, and when I click on save, I get a blank screen and a clickable "Close widow" option. Yet, no modifications are made and new records are not added. The stocks folder has execute permission, and the Interface_creator/uploads write permission (with the files from the prior version)

I set the debug option in the config.php file on, and in the popup windows for add or modify records, after clicking save I get the following error messages:

Notice: Undefined variable: use_limit_in_update in /var/www/html/stocks/interface_creator/business_logic.php on line 1564

Fatal error: Call to undefined function display_sql() in /var/www/html/stocks/interface_creator/business_logic.php on line 1570

Fatal error: Call to undefined function display_sql() in /var/www/html/stocks/interface_creator/business_logic.php on line 1752
Fatal error: Call to undefined function display_sql() in /var/www/html/stocks/interface_creator/business_logic.php on line 1752

Once again, I look forward to your feedback

Best regards

18

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

I apologize.... I had accidentally packed the wrong files in the zip file..

I have updated the zip file... it can be downloaded here. You only need to replace your current interface_creator/business_logic.php and interface_creator/common_start.php files with the files in the zip file.

Thank you for your help with testing this version.

19

Re: LabStoRe issues after Fedora system upgrade (?PHP version upgrade)

Thanks! That did it! It's working perfectly now.

Best regards