Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hangs after session_start() in includes/session.php in PHP 5.3.1 #17

Closed
apmuthu opened this issue Mar 17, 2018 · 18 comments
Closed

Hangs after session_start() in includes/session.php in PHP 5.3.1 #17

apmuthu opened this issue Mar 17, 2018 · 18 comments

Comments

@apmuthu
Copy link
Contributor

apmuthu commented Mar 17, 2018

Cannot login using PHP 5.3.1 in WinXPSP3.
Hangs at https://github.com/timschofield/webERP-svn/blob/master/includes/session.php#L39

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 23, 2018

admin user password weberp hash in www_users table set to:

$2n/2fEu2eudU

This is for PHP < 5.4

@TurboPT
Copy link
Contributor

TurboPT commented Mar 25, 2018

As you mentioned Windows XP SP3, what browser (and version) is in use on that system?

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 26, 2018

Tested on FireFox v22, 24.2, v52.2 ESR.

Also during installation, after inculcating the Fix for #16, only the weberpdemo company gets installed and the weberp company's 155 db tables do not get created (XAMPP v1.7.3).

What other data / code elements will change if a company is migrated from one installation to another - other than the config.php entry and some records in the config table?

Please note that the entries in the config table for the weberpdemo company refer to companies/test/... instead of companies/weberpdemo/.... that need to be corrected in the demo.sql file and possibly in the code as well.

@TurboPT
Copy link
Contributor

TurboPT commented Mar 27, 2018

Do the tables fail to install because of timeout, or some other issue with XAMPP?

For the original session_start(), are you sure it is that function, and not the line before that point?
(the httponly setting? ... try commenting that line out to see if it helps)

Which PHP and MySQL versions are in use with what you have?

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 28, 2018

If timeout be an issue, some sort of progress bar would expose it.

The fact is that no tables are created at all during the time the browser is waiting for data from the server, when monitored from a separate MySQL client.

By placing echo and an exit statements first before and then after the session_start() statement, the former displayed whilst the latter hung.

The XAMPP 1.7.3 sports PHP v5.3.1 and MySQL v5.1.41.

xampp_173_components

@TurboPT
Copy link
Contributor

TurboPT commented Mar 29, 2018

What is your session.save_handler value in php.ini with XAMPP?

Also, what is the path to xampp? Is at C:\xampp, or is it in C:\Program Files ?
I have XAMPP on windows 10, located at C:\xampp to avoid UAC issues at the other directory.
(of course I have newer versions of things...)

image

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 29, 2018

session.save_handler = files

If this is an issue, the script can temporarily set it to desired value using ini_set(.... and proceed.

@TurboPT
Copy link
Contributor

TurboPT commented Mar 29, 2018

That is the right setting. I'm trying to think of other things, and I'm running short on ideas.

What is your path to XAMPP?

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 29, 2018

There is no UAC in WinXP. Tried c:\XAMPP, d:\xampp, d:\servers\xampp - all same result.

@TurboPT
Copy link
Contributor

TurboPT commented Mar 30, 2018

True, I forgot about XP and (the lack of) UAC.

Are there any potential clues in the Apache log, or possibly the Windows XP admin event logs somewhere?

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 30, 2018

No clues anywhere in apache / application error logs.

It is necessary to run WebERP in such base level versions to provide confidence to those whose cloud instances fail and need a local instance where Windows of every hue is still popular and cannot be wished away any time soon.

What is the manual install sequence other than to

  1. create a database with same name as the company,
  2. copy of the weberpdemo folder,
  3. manual run of the default.sql on the company's database,
  4. replacing the hashed password in the user table to degrade to what is available in the PHP version used and
  5. make an entry in the config file for the login dropdown box?

@TurboPT
Copy link
Contributor

TurboPT commented Mar 31, 2018

Those install steps appear to be correct, though I must admit that it's been awhile since I've done a 'clean' install...

I understand the "older windows" factor. Unfortunately, the causes/reasons for the session_start() hang are MANY -- and we just have to try and figure out the deal for your situation.

In your php.ini, can you try setting:

error_reporting=-1
display_errors=On
display_startup_errors=On
log_errors=On

Then save and restart Apache.

If those settings are still not helpful to discover any issue, can you attach a copy of the php.ini file from that XAMPP version so that I can see all the settings that are present?

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 31, 2018

My existing settings are:

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
display_errors = On
display_startup_errors = On
log_errors = Off
magic_quotes_gpc = Off
magic_quotes_runtime = Off
register_globals = Off

Even after turning on the log_errors, still no joy in the apache error log.
The gettext extension has been tested being turned on and commented out to no avail.

Tried setting the timeout value in line 490 to 180 seconds up from 120 originally - also to no avail.

Is this sql files data insertion line okay?

INSERT INTO `config` VALUES ('VersionNumber','4.14.1');

It appears that the Issue #16 is duplicated in the upgrade file as well.

A manual import of default.sql takes about 2 min 7 secs to execute and 4 min 28 secs in all to complete in a mysql client.

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 31, 2018

SQL fixes in #28 should fix this issue too. Will test and revert.

@apmuthu
Copy link
Contributor Author

apmuthu commented Mar 31, 2018

No joy.

The following have been discerned:
At Line 467 in install/index.php, the $Db is undefined as there is no place in the install form for choosing MysqlExt as mysql or mysqli. The value of the $_POST and other variables there are:

$NewSQLFile = '../sql/mysql/country_sql/default.sql';
$_POST = Array ( 
[CompanyName] => weberp
[CountrySQL] => default.sql
[TimeZone] => Asia/Kolkata
[Email] => [email protected]
[webERPPassword] => mypwd
[PasswordConfirm] => mypwd
[HostName] => localhost
[UserName] => root
[DatabaseName] => weberp
[Password] =>
[MysqlExt] =>
[UserLanguage] => en_GB.utf8
[MAX_FILE_SIZE] => 10240
[Install] =>
[Database] => weberp
) ;

As a consequence, the next two statements fail - PopulateSQLData() and DBUpdate().

@apmuthu
Copy link
Contributor Author

apmuthu commented Apr 1, 2018

The function that fails is:

PopulateSQLData()

This is since the $Db value does not get passed onto the $db argument in the function.

When only a single database is chosen to be created during install, the values of the arguments passed to the above function call in Line 467 of install/index.php are:

$Demo: bool(false)
$Db: object(mysqli)#1 (17) { 
  ["affected_rows"]=> int(1) 
  ["client_info"]=> string(6) "5.1.41" 
  ["client_version"]=> int(50141) 
  ["connect_errno"]=> int(0) 
  ["connect_error"]=> NULL 
  ["errno"]=> int(0) 
  ["error"]=> string(0) "" 
  ["field_count"]=> int(0) 
  ["host_info"]=> string(20) "localhost via TCP/IP" 
  ["info"]=> NULL 
  ["insert_id"]=> int(0) 
  ["server_info"]=> string(6) "5.1.41" 
  ["server_version"]=> int(50141) 
  ["sqlstate"]=> string(5) "00000" 
  ["protocol_version"]=> int(10)
  ["thread_id"]=> int(72)
  ["warning_count"]=> int(1)
}
$DBConnectType: string(6) "mysqli"
$DatabaseName: string(6) "weberp"

Furthermore, there is no check for successful completion on return from this function before the next one proceeds to update with the user preference data.

Attempting to single-step into the function PopulateSQLData() shows that the $Db object does get passed on inside the function as $db properly and yet no tables are created. Does this need to be passed by reference in older PHP versions?

@apmuthu
Copy link
Contributor Author

apmuthu commented Apr 3, 2018

Further fixes here result in error-free installation.

@TurboPT
Copy link
Contributor

TurboPT commented Apr 12, 2018

Tim, can this issue be closed, fixed by #28 ?

@apmuthu apmuthu closed this as completed Apr 12, 2018
timschofield pushed a commit that referenced this issue Mar 26, 2019
Merge from webERP-team/webERP
Repository owner locked and limited conversation to collaborators Sep 29, 2024
@timschofield timschofield converted this issue into discussion #174 Sep 29, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants