• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

[PHP] Problem migrating server to windows

bury

Active Member
Joined
Jul 27, 2008
Messages
421
Solutions
7
Reaction score
25
Hello.

I had an ot server hosted in debian like 3 or 4 years ago. I kept everything about the server (data, db, website) and I touched up everything a little to remember old times and who knows if anything else.

The point is that I downloaded a xampp from 2013, the last year I had my server on and tried to run the website (actually, I have no problem running the data in 64 bits at least atm). There are several php errors when i try to run the website, errors that i didnt have years ago... so maybe i'm using a newer php or something, idk.

There are one warning and several notices:

PHP:
Warning: syntax error, unexpected '=' in cache/serverstatus on line 1 in C:\xampp\htdocs\config-and-functions.php on line 397

Notice: Undefined index: action in C:\xampp\htdocs\index.php on line 21

Notice: Undefined index: account_login in C:\xampp\htdocs\index.php on line 50

Notice: Undefined index: password_login in C:\xampp\htdocs\index.php on line 51

Notice: Undefined index: united states in C:\xampp\htdocs\latestnews.php on line 102

Notice: Undefined index: canada in C:\xampp\htdocs\latestnews.php on line 102

Notice: Undefined index: finland in C:\xampp\htdocs\latestnews.php on line 102

Notice: Undefined index: india in C:\xampp\htdocs\latestnews.php on line 102

After this errors, the website starts. Do you know what version of php should I download?
 
Instala el uniformserver siguiendo el tutorial de acá y nos cuentas como te fué, porque no son errores graves (Exceptuando el primero), solo son warnings por variables no declaradas
 
Instala el uniformserver siguiendo el tutorial de acá y nos cuentas como te fué, porque no son errores graves (Exceptuando el primero), solo son warnings por variables no declaradas

De acuerdo, instalo la última no (es de hace unos días, 2017)? O la que instalan en el tutorial?
 
index.php: http://pastebin.com/DZ2Szy1h
latestnews.php: http://pastebin.com/UQqpHXV1

also post your config-and-functions.php here. and btw, keep the thread in English please.

Oh, sorry Cornex. I dont mind to speak in english or spanish. Thanks for your files, I downloaded the last version of uniserver Z and followed the full tutorial of znote (the videotutorial). Ok, he made a website with znote acc and mine I think it was gesior acc. Anyway doing the same than with xampp website is not working:

"
La página localhost no funciona
La página localhost no puede procesar esta solicitud ahora.

HTTP ERROR 500"

It means in English: The website localhost is not working. The website localhost cant process this request now. HTTP ERROR 500.

I made it like with xampp, pasting the files in the folder "www". The website takes the db information in the config.lua through the file that you name: config-and-functions.php and config.ini. Here you have the first:

http://pastebin.com/ThiMjzg8

I'll wait for an answer before try that files in xampp. I like this pack "uniserver" and I see lot of open tibia servers use it so maybe i can use it, or if u guys tell me to try xampp again with the fixed files, no problem.

Pd. Tibia works without problem again with this mysql/apache so db information is properly set in config.lua.
 
De preferencia la última, como se te haga más fácil

Gracias, I used the last one. Up I explained what I finally did. This pack looks cool but it doesn't work with my website. I dont know why its all blank with that error. Tibia works 100% at least. Thanks.
 
Enable PHP errors on your php.ini file

I enabled all errors in test, production and development (some of them were enabled yet). I have this 4 files, what of them should I check and in what part of the document? Since they are really long and in the last part I don't find anything. Thanks.

php_production.ini
php_development.ini
php_test.ini
php-cli.ini
 
Last edited:
Thanks to znote I could start the server in uniserv but with several errors, with that files too, cornex. It's obiously I used a different version of PHP in that time (2012/13) but I dont know which. Website takes a bit in loading every subtopic (like 1 second) and its because there are lot of errors I guess. Anyway it works at 60% more or less. Characters and guilds doesn't work.

Error.log example:

Code:
[Sat Jan 14 23:44:05.034264 2017] [php7:warn] [pid 8588:tid 1748] [client ::1:49170] PHP Warning: syntax error, unexpected '=' in cache/serverstatus on line 1\n in C:\\UniServerZ\\www\\config-and-functions.php on line 397, referer: http://localhost/index.php?subtopic=characters
[Sat Jan 14 23:44:06.046709 2017] [php7:notice] [pid 8588:tid 1748] [client ::1:49170] PHP Notice: Undefined variable: action in C:\\UniServerZ\\www\\index.php on line 25, referer: http://localhost/index.php?subtopic=characters
[Sat Jan 14 23:44:06.057737 2017] [php7:notice] [pid 8588:tid 1748] [client ::1:49170] PHP Notice: Undefined variable: main_content in C:\\UniServerZ\\www\\characters.php on line 27, referer: http://localhost/index.php?subtopic=characters
[Sat Jan 14 23:44:06.057737 2017] [php7:notice] [pid 8588:tid 1748] [client ::1:49170] PHP Notice: Undefined variable: number_of_rows in C:\\UniServerZ\\www\\characters.php on line 28, referer: http://localhost/index.php?subtopic=characters
[Sat Jan 14 23:44:06.057737 2017] [php7:notice] [pid 8588:tid 1748] [client ::1:49170] PHP Notice: Undefined variable: number_of_rows in C:\\UniServerZ\\www\\characters.php on line 28, referer: http://localhost/index.php?subtopic=characters
[Sat Jan 14 23:44:06.058769 2017] [php7:error] [pid 8588:tid 1748] [client ::1:49170] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in C:\\UniServerZ\\www\\characters.php:48\nStack trace:\n#0 C:\\UniServerZ\\www\\index.php(125): include()\n#1 {main}\n thrown in C:\\UniServerZ\\www\\characters.php on line 48, referer: http://localhost/index.php?subtopic=characters


any idea which way to go?
 
Found this in a .sql I exported when I had the server. It could be a clue of what php version I was using that time, I guess.

-- MySQL dump 10.13 Distrib 5.1.66, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: server
-- ------------------------------------------------------
-- Server version 5.1.66-0+squeeze1


Any idea?
 
Patching the mysql queries to support mysqli is not very hard, have a look at how I did it back in 2014:
https://github.com/Znote/ZnoteAAC/c...00768f2#diff-5577cdf6c8290f608cddac37f344f6da

The function name is mysqli_stuff instead of mysql_stuff. When you establish the mysql connection, store it to a variable ( $connect ) and use that variable as the first parameter in all the other mysqli functions.

If you have any files that begin with <?= then replace it to <?php
 
Last edited:
Back
Top