Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Migrating WEBERP from windows 2012 to Centos 7.9 can't login
11-10-2022, 08:32 PM,
#1
Migrating WEBERP from windows 2012 to Centos 7.9 can't login
OLD system:
Windows 2012
MySql 5.7.17
IIS8.5
PHP7.3

New System:
Centos 7.9
MySql5.7
Nginx 1.22
PHP 8.1

It is estimated that there is a problem with the early system installation or other reasons, and it has been unable to upgrade to php7.4 or above, and because of php and some other settings, the running speed of weberp is very slow. So yesterday I migrated weberp from windows2012 to centos7.9

The database inside was backed up, the database name, user name and password were modified, and now the following error occurred:
Fatal error: Uncaught Error: Call to undefined function putenv() in /www/wwwroot/erp/config.php:27 Stack trace: #0 /www/wwwroot/erp/includes/session.php(14): include() #1 /www/wwwroot/erp/index.php(4): include('...') #2 {main} thrown in /www/wwwroot/erp/config.php on line 27

I don't know how to solve it, I tried to find a solution in the forum, but not yet, can anyone provide some help?

Very urgent, anyone who can help to resolve it would be greatly appreciated!
Reply
11-11-2022, 12:42 PM, (This post was last modified: 11-11-2022, 12:53 PM by TurboPT.)
#2
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
I'm confused.

According to PHP's information on putenv, the function has been available since PHP 4.

There's only 1 putenv() call in the config.php. Can you try commenting that out to see if one of the other calls in the system hits the same error?
Reply
11-11-2022, 05:19 PM,
#3
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
Now I changed to Php7.4, this puteuv error is still there, but I can login the webep.
then I got the information:Warning: putenv() has been disabled for security reasons in /www/wwwroot/erp/config.php on line 27
   
I deleted "putenv('TZ=Asia/Shanghai')" line, the problem is temporarily solved, and it seems that the operation is not affected.

But if changed back to PHP 8.1, but got other error information
Fatal error: Uncaught Error: Call to undefined function putenv() in /www/wwwroot/erp/includes/LanguageSetup.php:96 Stack trace: #0 /www/wwwroot/erp/includes/session.php(95): include() #1 /www/wwwroot/erp/index.php(4): include('...') #2 {main} thrown in /www/wwwroot/erp/includes/LanguageSetup.php on line 96
Reply
11-11-2022, 05:48 PM,
#4
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
Thanks Paul, Now I found the reason. When my friend installed php, the putenv function was disabled. Now problem was solved.
Reply
11-11-2022, 05:55 PM,
#5
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
But I still have a problem to solve. There was an old company in the system before. When the database was first established, the database name was directly used as mysql, but now in nginx, I can no longer use this database name. Now the new company name database remains the original name, it is no problem to use it, but the database of the old company can‘t be connected because the name has been changed. Where does it need to be set?
Reply
11-12-2022, 12:47 AM, (This post was last modified: 11-12-2022, 12:50 AM by TurboPT.)
#6
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
Possibly 2 places:

1. There's a companies table (column coyname), if there may be a reference.
2. In the webERP files system, there is a companies/ directory, if there may be a sub-directory reference to a company.
Reply
11-12-2022, 06:16 AM,
#7
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
(11-12-2022, 12:47 AM)TurboPT Wrote: Possibly 2 places:

1. There's a companies table (column coyname), if there may be a reference.
2. In the webERP files system, there is a companies/ directory, if there may be a sub-directory reference to a company.
Hi Paul,

The system has been running normally today, but this problem suddenly appeared half an hour ago. I don't know what happened?

Alex

Fatal error: Uncaught mysqli_sql_exception: No such file or directory in /www/wwwroot/erp/includes/ConnectDB_mysqli.inc:11 Stack trace: #0 /www/wwwroot/erp/includes/ConnectDB_mysqli.inc(11): mysqli_connect() #1 /www/wwwroot/erp/includes/ConnectDB.inc(54): include_once('...') #2 /www/wwwroot/erp/includes/session.php(47): include('...') #3 /www/wwwroot/erp/index.php(4): include('...') #4 {main} thrown in /www/wwwroot/erp/includes/ConnectDB_mysqli.inc on line 11
Reply
11-12-2022, 10:30 AM, (This post was last modified: 11-12-2022, 02:45 PM by TurboPT.)
#8
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
Check the includes/ directory, are the files present? ... if not, you should be able to copy them back to restore, or get the needed file(s) from GitHub.
Reply
11-12-2022, 10:37 PM,
#9
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
(11-12-2022, 10:30 AM)TurboPT Wrote: Check the includes/ directory, are the files present? ... if not, you should be able to copy them back to restore, or get the needed file(s) from GitHub.
Paul,

Thank you very much!

I really don't know much about centos. It seems that after migrating here, there are constant problems. Just now, the original error has been solved according to your method.

Thanks again!

Alex
Reply
11-14-2022, 06:22 AM,
#10
RE: Migrating WEBERP from windows 2012 to Centos 7.9 can't login
(11-12-2022, 10:30 AM)TurboPT Wrote: Check the includes/ directory, are the files present? ... if not, you should be able to copy them back to restore, or get the needed file(s) from GitHub.
Hi Paul,

Now I got another error, when I issue the invoice, we got the following information
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /www/wwwroot/erp/includes/MiscFunctions.php on line 17

But system seems still working, go to the next step, enter the delivery quantity, and then get another error.
Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given in /www/wwwroot/erp/includes/Add_SerialItems.php:113 Stack trace: #0 /www/wwwroot/erp/includes/InputSerialItems.php(19): include() #1 /www/wwwroot/erp/ConfirmDispatchControlled_Invoice.php(84): include('...') #2 {main} thrown in /www/wwwroot/erp/includes/Add_SerialItems.php on line 113

Please help me, I don't know much about nginx, it seems that there are many unknown problems now.

Alex
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)