Jump to content
twison

Unable to use deprecated scripts

Recommended Posts

I have a game that I'm working on that is sadly scripted using older versions of PHP and is not supported by the newer servers that are offered these days. I seen that there was an option of being able to use the deprecated scripts if I used the MWG hosting service. So far I have still not been able to use my scripts on the server I have and there is too much code for me to rewrite is the little time I have available. Is there any thing I can do to make it possible to run the scripts without changing them or am I pretty much dead in the water?

Share this post


Link to post
Share on other sites

Without at least some minimal cleanup, the code likely will not work. I wouldn't say you are dead in the water by any means, but it will be some effort to get something effectively working.

Share this post


Link to post
Share on other sites
27 minutes ago, InverTed said:

Without at least some minimal cleanup, the code likely will not work. I wouldn't say you are dead in the water by any means, but it will be some effort to get something effectively working.

Thanks, looks like I'll just have to shake off some of my coding rust and do what cleaning up I can.

Share this post


Link to post
Share on other sites

@Davemay tweak your hosting if you ask nicely to run this, or you could look into running a mysql shim and upgrading the other functions that are depreciated 

Share this post


Link to post
Share on other sites
11 minutes ago, AdamHull said:

@Davemay tweak your hosting if you ask nicely to run this, or you could look into running a mysql shim and upgrading the other functions that are depreciated 

That would be nice if it is possible. I would need version 5.4 but wouldn't want to be an annoyance to Dave over such an issue.

Share this post


Link to post
Share on other sites

If MWG Hosting offered it and you paid, they are(well should be) obligated to provide that for you, or at least refund you your $1(if that's what you paid. LoL) Message him.

Share this post


Link to post
Share on other sites

Running multi-PHP versions side-by-side is possible. Getting relevant information now

1 hour ago, twison said:

I have a game that I'm working on that is sadly scripted using older versions of PHP and is not supported by the newer servers that are offered these days. I seen that there was an option of being able to use the deprecated scripts if I used the MWG hosting service. So far I have still not been able to use my scripts on the server I have and there is too much code for me to rewrite is the little time I have available. Is there any thing I can do to make it possible to run the scripts without changing them or am I pretty much dead in the water?

Addition; while I wouldn't recommend it as a long-term replacement, a "shim" can be a very useful tool while migrating versions.
In this case, a PHP5.4 shim would allow you to continue running 5.4 code on a 7 system.

Update:
MWG does support PHP5.4! (along with 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, and 7.4 - at the time of writing)

  • Like 1

Share this post


Link to post
Share on other sites
11 minutes ago, Magictallguy said:

Running multi-PHP versions side-by-side is possible. Getting relevant information now

Addition; while I wouldn't recommend it as a long-term replacement, a "shim" can be a very useful tool while migrating versions.
In this case, a PHP5.4 shim would allow you to continue running 5.4 code on a 7 system.

A Shim is something new to me and have no knowledge of how to obtain and implement one at this time. Any advice or recommendations for a Shim would be most appreciated.

Share this post


Link to post
Share on other sites

dshafik's php7-mysql-shim may be of use to you here.
Easiest way to implement, I feel, is through Composer. Simply require the package in, include the vendor's autoload.php, go!
Failing that, grab a copy of src/mysql.php (in the same Git repo), upload said copy to your files, include it before running any code that requires PHP5.4.

There are certain methods that cannot be replicated, even with a shim. However, you're less likely to run into these using game engines currently available on MWG.

Share this post


Link to post
Share on other sites

I figured I'd just start updating the scripts and already hit a snag.

[13-Jul-2020 01:30:29 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function mysqli_result() in /home/legendsm/public_html/register.php:22
Stack trace:
#0 {main}
  thrown in /home/legendsm/public_html/register.php on line 22

 

 

 

error.png

Share this post


Link to post
Share on other sites

try changing from mysqli_result() to mysqli_query(), that'll probably fix the issue.

  • Like 1

Share this post


Link to post
Share on other sites
17 minutes ago, InverTed said:

try changing from mysqli_result() to mysqli_query(), that'll probably fix the issue.

That did the trick, thank you!

Share this post


Link to post
Share on other sites
Posted (edited)

Just looked at the hosting, you can change the php version your self using the Multi PHP manager from within cpanel

 

https://www.inmotionhosting.com/support/website/how-to-change-php-versions-using-multiphp-manager/

Using the link above will show you how to do this and should be the same on your host, i would advise using 5.4 until you have converted to php 7

Edited by AdamHull
  • Like 1

Share this post


Link to post
Share on other sites
16 hours ago, Magictallguy said:

dshafik's php7-mysql-shim may be of use to you here.
Easiest way to implement, I feel, is through Composer. Simply require the package in, include the vendor's autoload.php, go!
Failing that, grab a copy of src/mysql.php (in the same Git repo), upload said copy to your files, include it before running any code that requires PHP5.4.

There are certain methods that cannot be replicated, even with a shim. However, you're less likely to run into these using game engines currently available on MWG.

To expand on that what @Magictallguy said, if you read that repo and follow the links, the author suggests this package as an alternative and looks really promising.

  • Like 2

Share this post


Link to post
Share on other sites
7 hours ago, AdamHull said:

Just looked at the hosting, you can change the php version your self using the Multi PHP manager from within cpanel

 

https://www.inmotionhosting.com/support/website/how-to-change-php-versions-using-multiphp-manager/

Using the link above will show you how to do this and should be the same on your host, i would advise using 5.4 until you have converted to php 7

Thank you that works perfect now. Just a few things to iron out and then I can get back to work on the development while also upgrading at the same time. Thanks for all the help everyone! 

  • Like 1

Share this post


Link to post
Share on other sites

just lower your php version in the cpanel but i would not recommend opening the game if the code is that old.

Share this post


Link to post
Share on other sites
15 hours ago, SwiftGameR said:

just lower your php version in the cpanel but i would not recommend opening the game if the code is that old.

I have done so and will not be opening the game to the public till after I have completely rewritten all the the scripts. The game is old and has always been extremely basic as far as content and I have been planning for years major upgrades to it and finally working towards making it happen.

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Yea i have been working on my mobsters online for years now never got around to finishing it its built off the new grpg v2 script but i took out the features i did not like / want and coded it in the way i want.

Its not live but your more than welcome to check it out. Quite a  few of the city links wont work as i have not added / moved the file to a folder (i have kept all my games like 50/50 crack safe etc.) in its own folder so when i need to fix something i know where to go instead of looking for the file.

Mobsters Online

Edit: Well there seems to be a csrf issue happening withing the script right now so you can't actually register but if you wish let me know i can get you a demo account up but until i get into the files and find out why csrf is screwing up not very much in the game will work.

a.png

b.png

c.png

d.png

Edited by SwiftGameR

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...